diff --git a/Client-Side Components/UI Actions/Convert Catalog Task to a story/Readme.md b/Client-Side Components/UI Actions/Convert Catalog Task to a story/Readme.md new file mode 100644 index 0000000000..72bdf107a6 --- /dev/null +++ b/Client-Side Components/UI Actions/Convert Catalog Task to a story/Readme.md @@ -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. + +image diff --git a/Client-Side Components/UI Actions/Convert Catalog Task to a story/script.js b/Client-Side Components/UI Actions/Convert Catalog Task to a story/script.js new file mode 100644 index 0000000000..3f69112621 --- /dev/null +++ b/Client-Side Components/UI Actions/Convert Catalog Task to a story/script.js @@ -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); diff --git a/Client-Side Components/UI Actions/Convert Incident to a story/ReadMe.md b/Client-Side Components/UI Actions/Convert Incident to a story/ReadMe.md new file mode 100644 index 0000000000..665e725dad --- /dev/null +++ b/Client-Side Components/UI Actions/Convert Incident to a story/ReadMe.md @@ -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. + +image diff --git a/Client-Side Components/UI Actions/Convert Incident to a story/code.js b/Client-Side Components/UI Actions/Convert Incident to a story/code.js new file mode 100644 index 0000000000..71cf35b2a7 --- /dev/null +++ b/Client-Side Components/UI Actions/Convert Incident to a story/code.js @@ -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); diff --git a/Server-Side Components/Business Rules/Reset Change model workflow when model changes/Readme.md b/Server-Side Components/Business Rules/Reset Change model workflow when model changes/Readme.md new file mode 100644 index 0000000000..18a16c6e72 --- /dev/null +++ b/Server-Side Components/Business Rules/Reset Change model workflow when model changes/Readme.md @@ -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 diff --git a/Server-Side Components/Business Rules/Reset Change model workflow when model changes/code.js b/Server-Side Components/Business Rules/Reset Change model workflow when model changes/code.js new file mode 100644 index 0000000000..5cad0bfab3 --- /dev/null +++ b/Server-Side Components/Business Rules/Reset Change model workflow when model changes/code.js @@ -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);