Need to show CR link

Lucky1
Tera Guru

Hello All,

 

In the workflow, after a task completion, I am creating a record in a change request table, 

So, can someone tell me how to navigate the user to the created change request. Because he then goes to the form and clicks on Request approval.

 

 

Regards,

Lucky

1 ACCEPTED SOLUTION

@Lucky1 ,

 

I have already posted in one of my replies 

Steps :

You can remove default value on the URL field

In your create task workflow activity , script section have this logic

var chg = current.getDisplayValue('change_request'); // this will give you the change number
chg = " This CR is created from the"+" "+chg 

//in the URL after u r passing "^u_cmdb_update_from_ctask=yes" add ^short_description=chg
//example url looks below and update the URL field , you can see chg is passed without quotes and its awlays dynamic

current.urlfieldvalue ="/change_request.do?sys_id=-1&sysparm_query=chg_model=007c4001c343101035ae3f52c1d3aeb2^type=normal^short_description="+chg +"^EQ&sysparm_use_polaris=true&sys_target=change_request&sysparm_referring_url=change_request_list.do%3Fsys_id%3D-1%26sys_target%3Dchange_request%26sysparm_fixed_query%3D%26sysparm_group_sort%3D%26sysparm_query%3D%26sysparm_target%3D%26sysparm_view%3D";

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

View solution in original post

17 REPLIES 17

Hi Hemanth,

 

1. Yes, i have hard coded in the Default value of URL field.

2. How can I pass CR number dynamically from Create Task activity in the work flow? As I need to show the link on the Change task form.

 

Please guide me here, this is my last step on this task.

 

 

Regards,

Lucky

@Lucky1 ,

 

I have already posted in one of my replies 

Steps :

You can remove default value on the URL field

In your create task workflow activity , script section have this logic

var chg = current.getDisplayValue('change_request'); // this will give you the change number
chg = " This CR is created from the"+" "+chg 

//in the URL after u r passing "^u_cmdb_update_from_ctask=yes" add ^short_description=chg
//example url looks below and update the URL field , you can see chg is passed without quotes and its awlays dynamic

current.urlfieldvalue ="/change_request.do?sys_id=-1&sysparm_query=chg_model=007c4001c343101035ae3f52c1d3aeb2^type=normal^short_description="+chg +"^EQ&sysparm_use_polaris=true&sys_target=change_request&sysparm_referring_url=change_request_list.do%3Fsys_id%3D-1%26sys_target%3Dchange_request%26sysparm_fixed_query%3D%26sysparm_group_sort%3D%26sysparm_query%3D%26sysparm_target%3D%26sysparm_view%3D";

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Hi Hemanth,

 

Thanks a lot for your Patience and helping on this.

Thanks a lot.

it's working

 

 

Regards,

Lucky