how to show ritm number in short description field on change request form

Arjun Reddy Yer
Tera Guru

Can anyone help me in how to show RITM number in short description on change request form.

To auto populate Change Request Planned Start Date depending upon the RITM creation date 

aAs mentioned in below screen shot the highlighted fields should get auto populate when the User select the option in Catalog Item @Ankur Bawiskar @BharathChintala @Anil Lande @Sumalatha Y @mattystern @SatyakiBose @asifnoor @Pradeep Sharma 

yerasumalli_0-1678240488030.png

yerasumalli_0-1678247547468.png

as the Impact Business Unit field is refered to a below mention varaible 

yerasumalli_1-1678247628920.png

in the data lookup table when the User selects Group then the Local/Regional CAB field should populate Regional CAB other wise it should populate Local CAB

 

1 ACCEPTED SOLUTION

Hi @Arjun Reddy Yer ,

 

AnveshKumarM_0-1678357212156.png.

 

In the screenshot above you haven't created any GlideRecord reference for change record, but you are calling a variable called "changeGlideRecord", so it's throwing error in that step of work flow.

 

If you want to create a change Request along with the Task, You should write code something like this.

var changeGlideRecord = new GlideRecord();
changeGlideRecord.initialize();
changeGlideRecord.short_description = current.number + 'Standard Change Request for Firewall Change Request';
changeGlideRecord.satrt_date = current.created.addDays(11);
/* Populate all the change field values here like this*/
....
....
changeGlideRecord.insert();

 

For the Local/Regional CAB field, as you said the company is a reference field, there should be some criteria to identify which is the group company and which is not. If you can share us that we can help in writing the logic to populate the Local/Regional CAB fields.

 

Thanks,

Anvesh

Thanks,
Anvesh

View solution in original post

29 REPLIES 29

@Arjun Reddy Yer may i know if it is working

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful

Not working below error I got when I created a request. It's not even creating Change request

yerasumalli_0-1678264454610.png

 

@Arjun Reddy Yer if Create task activity is creating change_request and workflow is on request item

 

If yes then please change the script to below and try

 

task.short_description=current.number+'  '+'Standard change Request for Firewall Change Request';

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful

got it now it's working fine but can we populate Change Request Number on SCTASK Short description field and how about Plan Start Date as it should populate value of RITM creation date and the Impact Business Unit field, Local/regional CAB field also need to auto populate according to the variable selection on catalog item as I had mentioned in the post starting

@Arjun Reddy Yer 

to populate planned start date write below code

 

task.start_date=current.sys_created_on

 

to populate fields from variables you can write in below way

task.business_unit=current.variables.YOUR VARIABLE NAME;

task.cab_field=current.variables.YOUR VARIABLE NAME;

 

you can try populating change request number in sc task write the below script in catalog task script section.

 

var gr = new GlideRecord('change_request');

gr.ddQuery('parent',current.request_item);

gr.query();

if(gr.next())

task.shortdescription= gr.number;

 

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful