Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Catalog task(sc_task)-to-Story Conversion UI Action

As a ServiceNow admin, I want to be able to convert catalog task into Development Stories with a single UI action so that operational issues can be seamlessly transitioned into Agile work items for remediation and platform improvement.
Very helpful if requests requires development effort.

<img width="1297" height="561" alt="image" src="https://github.com/user-attachments/assets/247fd360-966a-4090-b497-12ec742c4236" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Initialize new GlideRecord for rm_story table
var gr = new GlideRecord("rm_story");

// Copy description from current record (likely a Requested Item or similar)
gr.description = current.description;

// Set story type to 'Enhancement'
gr.type = "Enhancement";

// Assign requested_for user as tester
gr.u_tester = current.request.requested_for; //custom field-optional

// Link story to source record via u_created_from field
gr.u_created_from = current.sys_id; //optional custom field to link request to story

// Insert the new story and capture its sys_id
var sysID = gr.insert();

// Store the story sys_id in the source record for traceability
current.rm_story_id = sysID;

// Update the source record
var mySysID = current.update();

// Display confirmation message with story number
gs.addInfoMessage("Agile Story " + gr.number + " created");

// Redirect user to the newly created story
action.setRedirectURL(gr);

// Set return URL to the original source record
action.setReturnURL(current);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Incident-to-Story Conversion UI Action

As a ServiceNow admin, I want to be able to convert incidents into Development Stories with a single UI action so that operational issues
can be seamlessly transitioned into Agile work items for remediation and platform improvement.
Original incident can be closed with story number as a reference for the user.

Very helpful if incident requires development effort.

<img width="1207" height="563" alt="image" src="https://github.com/user-attachments/assets/8f295ee0-b922-442b-806a-7cdda3876508" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Get caller ID from the incident record
var callerID = current.caller.id;

// Initialize new story record
var gr = new GlideRecord("rm_story");
gr.short_description = current.short_description; // Copy short description
gr.description = current.description; // Copy full description
gr.type = "Fix"; // Set story type to 'Fix'

// Assign caller as tester
gr.u_tester = current.caller_id;

// Link story to originating incident
gr.u_created_from = current.sys_id; //cutom field to populate incident record or request -not required

// Insert story and capture its sys_id
var sysID = gr.insert();

// Store story sys_id on incident for traceability
current.rm_story_id = sysID;

// Update incident record
var mySysID = current.update();

// Display confirmation message with story number
gs.addInfoMessage("Agile Story " + gr.number + " created");

// Redirect user to newly created story
action.setRedirectURL(gr);

// Set return URL to original incident
action.setReturnURL(current);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#contribution
This Business Rule will reset previous workflow changes, when the model field on a change record changes to a different model.
Table - Change Request (change_request)
Advanced set to True
When to Run - Before Update
Filter Conditions: Model changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//This Business rule will reset a change workflow ,when the change model changes
(function executeRule(current, previous /*null when async*/) {

// Create a new instance of the Workflow class
var wkfw = new Workflow();

// Delete the workflow associated with the current record
wkfw.deleteWorkflow(current);

})(current, previous);
Loading