Converting SCTASK to an Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 06:53 AM
I would like to see a change to the process that converts a completed SCTASK to an incident to resolve issues with what was previously fulfilled. This change would show the SCTASK record as a related record on the incident. The same would be true on the SCTASK showing the incident as a related record.
Additionally, the conversion process could automatic populate the SCTASK # in the new incident's description.
Any ideas that would enable us to do this while also remaining as OOTB as possible?
Thank you much
- Labels:
-
Reporting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 07:08 AM
Just add UI Action on sc_task table which will create incident and copy some data also add relation between inc and task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 07:12 AM
Do you have or could you reference some examples that might work best?
Also, would we have any issues with these UI Actions when we upgrade to Madrid? Again OOTB is key for us.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2019 07:30 AM
Hi,
Just mentioning this...you posted this in the performance analytics and reporting section of the forums...so you'd really want to post this in the development community. I just happen to scan all forums for posts and saw this so I wanted to throw that out there.
Now on to your request, your going away from OOB by doing this anyway. The moment you add a feature or something customized, which this would be, you're going outside out of box. So to repeat for inside the box, there isn't a default setting or feature which would take an SCTask and convert it to incident.
As far as creating a UI Action as Slawek mentioned above, that shouldn't break when upgrading to Madrid as it would only be using code with pieces like "current" and "insert" and those are all pretty basic stuff.
This is documentation on UI Action from ServiceNow: https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/list-administratio...
This is a good reference site on looking at GlideRecord and using insert (just scroll down to insert) and you'll get the idea from here: https://www.servicenowguru.com/scripting/gliderecord-query-cheat-sheet/
You'd just want to glide to the incident table, initialize and then start to port over the data by doing lines such as:
newINC.short_description = current.short_description;
This assumes you've used newINC as your variable for the glide and you want the new Incident short description to be the same as the task short description.
That's just an example.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!