Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to set the Due date of RITM and Task same as variable selected in Service Catalog

Naresh_5120
Tera Contributor

Hi Community,

 

I have created a termination form in Service Catalog item , when a termination form is filled by users, there is filed called Effective date (variable is name effective_date) select for the actual termination date. I want to show the same date as RITM Due date and Task due date, however it is not happening currently.

 

Can someone suggestion how can I achieve the output.

 

Effective Date Selected is - 

Naresh9_0-1674622412470.png

 

RITM Date is showing is

Naresh9_1-1674622448607.png

 

Task Due date is showing is

Naresh9_2-1674622489183.png

 @Ankur Bawiskar I saw your other post where you have provided solution but that thread is closed, therefore tagging here for help!

11 REPLIES 11

Ankur Bawiskar
Tera Patron
Tera Patron

@Naresh_5120 

you can use workflow run script activity for this

Remember you have date field but target field is date/time so you need to add time also

current.setValue('due_date', new GlideDateTime(current.variables.effective_date) + ' 23:59:59');

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Really appreciate your help, i have tried to run the script but not getting the effective date as due date in Catalog Task.

 

Below is the screenshot of of workflow, I am running this script in Catalog Task. I am a missing something here.

 

Naresh9_1-1674816553973.png

 

@Naresh_5120 

please share script

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Below is the script.

Naresh9_0-1674819601897.png

 

@Naresh_5120 

so what date it's setting?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader