- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2024 07:59 AM
I have a script (see below) that converts Incident tickets to REQ/RITM/SCTASK. One of the last steps of the script is to add a note to the Incident activity log and then cancel the Incident. I created a new field on the Incident form called Related Task (u_reference_2) so we can have a link between the canceled incident and the new REQ/RITM/SCTASK. The issue I am having is that I cannot get the newly created SCTASK number to populate into the new Incident filed. I'm new to this whole script stuff, so if any one can help me I would appreciate it greatly.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2024 09:53 AM
Hi @RobertPC ,
Try changing the line:
taskRec.insert();
To:
var scTaskSysId = taskRec.insert();
Then use the variable to update the current incident:
current.setValue('u_reference_2', scTaskSysId);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2024 09:53 AM
Hi @RobertPC ,
Try changing the line:
taskRec.insert();
To:
var scTaskSysId = taskRec.insert();
Then use the variable to update the current incident:
current.setValue('u_reference_2', scTaskSysId);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2024 10:57 AM
That works great, thanks so much for the help