- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:28 AM
I have requirement where in transform map script(here Source table: staging table and target table : cmdb_ci) I have to check certain values(application_owner, application name) from sc_req_item table based on a match of 'alert id' and get values from sc_req_item table and update in target table(cmdb_ci).
I have written below code in Transform map script but I am not able to fetch values from sc_req_item table.The if loop (line 19) is getting executed i.e condition evaluates true, but I am not able to get value of 'Application_owner' , 'application_name'(line 20,21 not returning value). Please suggest how to achieve this.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:59 AM
Hi
if application_owner and application_name are variables on sc_req_item table then update below lines as.
application_owner = gr_req.variables.application_owner;
application_name= gr_req.variables.application_name;
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:44 AM
H Sudhanshu,
Yes i have correct field name in target.u_application owner it is the field in my target table(cmdb_ci).
Also , here I am not able to fetch the value from sc_req_item table itself at the first place.( 20,21) though the if loop is true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:50 AM
Yes,
Tell me on thing do you have any CI reference there in requested item as you are writing glidequery on ritm table?
If yes which field is that one?
Thanks
Sudhanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 08:02 AM
If these are catalog variables of RITM,
then
gr_req.variables.variable_name;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:43 AM
Hello Geeta,
Try with logs.
gs.log(gr_req.application_owner);
gs.log(gr_req.application_name);
if(gr_req.next()){
application_owner = gr_req.application_owner;
application_name= gr_req.application_name;
}
target.application_owner= application_owner;
target.u_application_name = application_name;
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:52 AM
Hi Sagar,
I have applied logs and I am not getting value from sc_req_item table not usre why even if I am inside if loop.
Also, application_owner field is refrence field in both tables. Application_name is string field.