how to display change request number in ritm description filed once change request is created

Arjun Reddy Yer
Mega Sage

Can anyone help me @Vasantharajan N @Ankur Bawiskar 

 

As I need to display change request number in ritm description filed once change request is created

Tried with Business Rule and the condition is when the change state is in New. 

But not able to get the Change Request number.

 

Business Rule: 

var chnGr_sysId = current.change_request.toString();
var riTs = new GlideRecord('sc_req_item');
riTs.addQuery('parent', chnGr_sysId);
riTs.addActiveQuery(); 
riTs.query();
if (riTs.next()) {

    riTs.description = current.number.toString(); 
    chGr.update();

}

 

1 ACCEPTED SOLUTION

@Arjun Reddy Yer - Please try this code and let us know.

var chnGr_sysId = current.sys_id.toString();
var riTs = new GlideRecord('sc_req_item');
riTs.addQuery('parent', chnGr_sysId);
riTs.addActiveQuery();
riTs.query();
if (riTs.next()) {
    riTs.description = current.number.toString();
    riTs.setWorkflow(false);
    riTs.update();
}

 


Thanks & Regards,
Vasanth

View solution in original post

21 REPLIES 21

it's not working tried with both When to Run: before and after 

ArjunReddyYer_0-1683887448496.png

ArjunReddyYer_1-1683887486376.png

 

tried with before BR also ?

yes tried with before BR also but not working

Hi @Arjun Reddy Yer ,

 

The RITM and SCTASK are created automatically. So you can also update the record in the background. Can you please try with Async type BR ?

 

Please try and let us know still you are facing the issue.

 

If I have answered your question, please mark my response as correct/Helpful.

 

Regards,

Pushkar

it's not working

ArjunReddyYer_0-1683937696341.png

ArjunReddyYer_1-1683937767923.png