Retrieve sys id of RITM in the run script of workflow

Swathi P
Tera Guru

Hi All,

 

Is there any possibility to return the sys id of RITM in the runscript of workflow?

We need to perform few activities in the workflow runscript once we get the sys_id of RITM .

Please suggest.

Thanks 

Swathi P

1 ACCEPTED SOLUTION

Yes. It will work


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

If you are talking about the Workflow running on requested Item table, you can just use current.sys_id.

 

if you are running the workflow on Request, you need a script something like below

 

var ritm = new GlideRecord('sc_req_item');

ritm.addQuery('request',current.sys_id);

ritm.query();

 

if(ritm.next())

{

gs.info('++++++++++++RITM sys id is +++++++++++++++'+ritm.sys_id);

}


Please mark this response as correct or helpful if it assisted you with your question.

will it work on scoped applications as well? We have catalog items on scoped applications

Yes. It will work


Please mark this response as correct or helpful if it assisted you with your question.