File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Client-Side Components/UI Actions/Convert Incident to a story Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ // Get caller ID from the incident record
2+ var callerID = current . caller . id ;
3+
4+ // Initialize new story record
5+ var gr = new GlideRecord ( "rm_story" ) ;
6+ gr . short_description = current . short_description ; // Copy short description
7+ gr . description = current . description ; // Copy full description
8+ gr . type = "Fix" ; // Set story type to 'Fix'
9+
10+ // Assign caller as both requirements owner and tester
11+ gr . u_tester = current . caller_id ;
12+
13+ // Link story to originating incident
14+ gr . u_created_from = current . sys_id ; //cutom field to populate incident record or request -not required
15+
16+ // Insert story and capture its sys_id
17+ var sysID = gr . insert ( ) ;
18+
19+ // Store story sys_id on incident for traceability
20+ current . rm_story_id = sysID ;
21+
22+ // Update incident record
23+ var mySysID = current . update ( ) ;
24+
25+ // Display confirmation message with story number
26+ gs . addInfoMessage ( "Agile Story " + gr . number + " created" ) ;
27+
28+ // Redirect user to newly created story
29+ action . setRedirectURL ( gr ) ;
30+
31+ // Set return URL to original incident
32+ action . setReturnURL ( current ) ;
You can’t perform that action at this time.
0 commit comments