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

@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

still not working

is it possible via workflow? @Ankur Bawiskar @nayanawadhiya1 

 

ArjunReddyYer_0-1683888649942.png

ArjunReddyYer_1-1683888686817.png

Workflow which is used for creation of Change Task and Catalog Task

ArjunReddyYer_0-1684136404670.png

 

Hello Arjun,

Is your RITM is still in Active true state after change creation?

If not then remove the rits.addActiveQuery() from the Business rule.

Dear @Arjun Reddy Yer 

Please try this, I tested and working.

KB18_1-1683881068549.png

 

KB18_2-1683881102898.png

 

Please hit the thumb Icon and mark as correct in case I help you with your query!!!
- Kailas

Dear @Arjun Reddy Yer 

Please try this, I tested and working.

KB18_0-1683881254294.png

 

 

KB18_1-1683881254320.png

 

 

Please hit the thumb Icon and mark as correct in case I help you with your query!!!
- Kailas