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,

 

You are 50% right here.

Let me tell you now clearly.

 

1. On the CTASK, we have a field (Yes/No) right?

2. So, once the user selects, Yes then another field will be shown using a UI policy and that field is of URL type.

3. That URL type field is navigating to new Change Request.

 

So, the requirement here is, once the user selects Yes on the Ctask and clicks that URL then it will take to new Change request right? So, in that Change request there is a field(Yes/No).

So, I want to make it Yes automatically, when the new CR form shown.

 

Regards,

Lucky

Ok got it, Pass "sysparm_query" from your URL on the CTAKS 

example:

New change url : 

/change_request.do?sys_id=-1&sysparm_query=u_cmdb_cr=true

this would set cmdb cr field to true when user click on this URL from CTASK

 

 

Accept and hit Helpful if it helps.

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

Hi Hemanth,

 

I tried this but it's not working.

 

Lucky1_0-1689671346328.png

 

 

Hi @Lucky1 

 

try : 

/change_request.do?sys_id=-1&sysparm_query=type=normal&u_cmdb_update_from_ctask=yes

 

I think type is already set as normal right? so we are adding AND condition to set the cmdb field.

%3d is "="

%5e is "^"

 

let me know how it goes

 

 

 

Accept and hit Helpful if it helps.

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

Ok hemanth,

 

So this is my entire URL of Change Request.

Can you tell me how I can automatically put the value to yes in this url?

 

Lucky1_0-1689683156953.png

Regards,

Lucky