Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How do you reuse an agile story?

Robert Campbell
Tera Guru

Let's take ServiceNow for an example.

  • Theme = Upgrade ServiceNow
  • Epic = ServiceNow Utah
  • Stories
    • Configuration Management
      • Task 1
      • Task 2
      • Task 3
    • Change Management
      • Task 1
      • Task 2
      • Task 3
      • Task 4
    • Incident Management
      • Task 1
      • Task 2
      • Task 3
    • Service Portal
      • Task 1
      • Task 2
      • Task 3
      • Task 4
      • Task 5
      • Task 6
    • Release Management
      • Task 1
    • Configuration Management
      • Task 1
      • Task 2
      • Task 3

Once we start testing for ServiceNow Venice (or whatever it will be called), we want to repeat this process w/o having to manually recreate all of these tasks.  We may need to add and/or remove tasks and then copy that to the next version testing but how do we redeploy these stories and tasks?

2 REPLIES 2

Jodi Hartman1
Tera Expert

Hi Robert,

 

Using Agile Development 2.0, the way I have tackled this is to create the epic with stories loosely based on the ServiceNow Upgrade Checklist. 

 

This set remains in the Product Backlog, and I manually copy each one into each iteration/sprint as new releases are made available.  One of these days, one of us needs to take the time to automate this workflow.  😉

 

JodiHartman1_2-1676073856916.png

Another option is to use story templates.

 

JodiHartman1_4-1676074053829.png

My outline is similar to yours (sharing for others):

 

EPIC
ServiceNow Upgrade (Release Name)

 

STORIES

 

PI | REVIEW | Release Notes

 

P2 | PLAN | Review Pre-Upgrade & Post-Upgrade Tasks for Installed Products
P2 | PLAN | Determine New Functionality & Notable Changes
P2 | PLAN | Confirm plans to enable or disable features introduced in the new product release
P2 | PLAN | Plan Upgrade with ServiceNow Applications

P2 PLAN | Cloning, Upgrading, & Testing - Include Plans for Communications & Training

P2 | PLAN | Identify Upgrade Support Team
P2 | PLAN | Align, Communicate, and Confirm Schedules with IT Teams
P2 | PLAN | Testing Approach
P2 | PLAN | Training
P2 | PLAN | Pre-Flight
P2 | PLAN | Clone

 

P3 DEV | Verify Upgrade Configurations & Schedule the DEV upgrade in Now Support
P3 DEV | Upgrade & Validate the DEV Instance

 

P4 TEST | Verify Upgrade Configurations & Schedule the TEST upgrade in Now Support
P4 TEST | Upgrade & Validate the TEST Instance

 

P5 QA | Verify Upgrade Configurations & Schedule the QA upgrade in Now Support
P5 QA | Upgrade & Validate the QA Instance

 

P6 PROD | Prepare to Upgrade PROD
P6 PROD | Upgrade PROD

 

P.S.  V=Vancouver, W=Washington, Y=YouWishYouKnew&SoDoI  LOL!

 

Kind regards,

 

Jodi.

Thanks to @Roel3 on Trying to copy Agile Story and associated scrum tasks in UI Action I was able to create UI Actions with:

 

// Created by: @Roel3 (SN Community)
// Tweaked by: Robert Campbell
//copy Story is working
var chgID = current.sys_id.toString();
var newChange = new GlideRecord('rm_story');
var newStorySysId;
newChange.initialize();
newChange.short_description = current.short_description;
newChange.assignment_group = current.assignment_group;
newChange.description = current.description;
newChange.assigned_to = current.assigned_to;
newChange.story_points = current.story_points;
newChange.product = current.product;
newChange.assignment_group = current.assignment_group;
newChange.theme = current.theme;
newStorySysID = newChange.insert();
//newChange.insert();

if (newStorySysID){
	//Copy attachments for this change - this is working
	if (typeof GlideSysAttachment != 'undefined')
		GlideSysAttachment.copy('rm_story', chgID, 'rm_story', newStorySysID);
	else
		Packages.com.glide.ui.SysAttachment.copy('rm_story', chgID, 'rm_story', newStorySysID);
	copyTask(newStorySysID,chgID);
	//copyCI(); don't need
	gs.addInfoMessage('Story ' + newChange.number + ' created.');
	action.setRedirectURL(newChange);
}


//copy scrum tasks is not working
function copyTask(ID,chgID) {
	//Find the current scrum tasks and copy them
	var tasks = new GlideRecord('rm_scrum_task');
	tasks.addQuery('story', chgID);
	tasks.query();
	while (tasks.next()) {
		var taskID = tasks.sys_id.toString();
		gs.addInfoMessage('task sys_id ' + taskID + ' task.');
		//Copy the task record to a new task record
		var newTask = new GlideRecord('rm_scrum_task');
		newTask.initialize();
		newTask.story = ID;
		newTask.short_description = tasks.short_description;
		newTask.description = tasks.description;
		newTask.assignment_group = tasks.assignment_group;
		newTask.assigned_to = tasks.assigned_to;
		newTask.insert();
		
		//Copy attachments for this task - this is not working since scrum tasks are not copying
		if (typeof GlideSysAttachment != 'undefined')
			GlideSysAttachment.copy('rm_scrum_task', taskID, 'rm_scrum_task', tasks.sys_id);
		else
			Packages.com.glide.ui.SysAttachment.copy('rm_scrum_task', taskID, 'rm_scrum_task', tasks.sys_id);
	}
}

 

This produced a copy of the story and all the tasks. 

 

What I realized is that I actually want to take a copy of the Epic, stories and tasks.  The way I'm viewing the layout is:

Product: ServiceNow Upgrade

Theme: ServiceNow Upgrade

Epic: ServiceNow Upgrade - Utah

Story: ServiceNow Upgrade - Utah - Baseline Change Management

Task: 1, 2, 3, 4

Story: ServiceNow Upgrade - Utah - Change Management

Task: 1, 2, 3, 4

Story: ServiceNow Upgrade - Utah - Baseline Incident Management

Task: 1, 2, 3, 4, 5, 6, 7

Story: ServiceNow Upgrade - Utah - Incident Management

Task: 1, 2, 3, 4, 5, 6, 7

Story: ServiceNow Upgrade - Utah - Baseline Release Management

Task: 1, 2, 3

Story: ServiceNow Upgrade - Utah - Release Management

Task: 1, 2, 3

 

I did a similar code to make a copy of the epic and stories but I'm still working on getting the tasks.  Can I call the "Copy Story" UI from the "Copy Epic" UI?  I'm thinking that if I can call it during each copy of the story, it would create the tasks but that is probably an oversimplification of the process.

 

One problem I see is that the Epic, story and tasks will be hardcoded with the version so I will need to make that a variable or not copy it but ask for input to change the short description.