- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2020 03:47 PM
We have a need to update the RITM Due Date after a SCTASK is closed(there is a date variable that is selected on this task). Once the date/time variable is selected, the task is closed, and we want the RITM Due Date to match the variable date/time selected. I put in a run script after that task is closed on the workflow but it's only setting the tasks that follow the 1st task to that due date. The RITM due date doesn't change.
Here's the run script:
current.due_date = current.variables.test_scan_target_date;
I was thinking I needed to use current.request_item.due_date = current.variables.test_scan_target_date; but that doesn't work at all and gives an error on the workflow.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 06:01 AM
Hello,
Firstly, please mark those replies above as Helpful, if they were...as you can see I did quite a bit of work on that.
Secondly, did the due date change? You didn't confirm that, but just said it "seems to let the run script work". As far as the tasks after it showing as cancelled, I'm not understanding how this run script has to do with that, but what you can also try to do is add a 1 second timer activity right after the run script to let the workflow breath for a second.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2020 06:59 PM
To confirm...I went ahead and did this myself just to show you.
Sample RITM (showing you due date before the script happens):
Task with the field on it:
I'll fill it in for WAYYY in the future
Now I'll close the task
...and checking RITM due date:
And this is the workflow (just to show the initial steps):
Annnddd the script I used in the run script, which is what I figured you could use and not even need my script above:
So that's all you need.
However....for fun...I did my script too just to ensure I wasn't suggesting something that doesn't work and it does work:
With script:
But again, you shouldn't need to do that, but it is an alternative.
Please mark reply as Helpful/Correct, thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2020 09:56 PM
1.) I do not have that in the script
2.) it's on the sc_req_item table.
3.)
4.) Yes it's a true date/time field.
5.) Haven't set up logs yet. Here's the variable filled out on SCTASK.
The script you provided seems to let the run script work, however the tasks after it runs are showing as "cancelled".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 06:01 AM
Hello,
Firstly, please mark those replies above as Helpful, if they were...as you can see I did quite a bit of work on that.
Secondly, did the due date change? You didn't confirm that, but just said it "seems to let the run script work". As far as the tasks after it showing as cancelled, I'm not understanding how this run script has to do with that, but what you can also try to do is add a 1 second timer activity right after the run script to let the workflow breath for a second.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2020 04:16 AM
When I said it seemed to work I should of been more clear. There was no error on the workflow activity, but the RITM due date did not change. I'll add the timer and see if that helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2020 05:35 AM
Ok, sounds good.
Hopefully you have success. At this point, I'm wondering if there is something else going on because I've done pretty extensive work on this and give exact screenshots/examples of all testing I've done above.
If anything else has been helpful that I've replied with through this thread, please mark as Helpful.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!