Linking Update Set to Agile Story
Hello Everyone,
I recently came up with a useful solution to help deployments move along a bit more seamlessly for my organization. Our team uses the Agile Development application to create and track work for our sprints. We also use Update Sets to build and move our work from lower environments up to Production. It has always been odd to me that there is no link or related list that tie Update Sets to Stories. The below solution is to solve for that.
Considerations:Your deployment process may differ slightly or significantly from how our team does them. Below are the situations I needed to account for:
- Our development happens in our Dev environment, but the Stories only live in our Production environment. Because of this, I could not just add a reference field to either table as the actual data is in two different instances.
- We use the Stories Scrum view - List during the deployment process as a way to organize the update sets and sort them by the type of configuration item. This works well for the team so some of this process was built around still using that.
- Maybe not out of the ordinary, but we can have multiple update sets that are tied to a single story. In the case that we have multiple update sets, we also need to determine which to commit first.
Solution: The solution here is pretty easy to implement -
- On the sys_update_set table I added two fields - A string field called 'Story Number' and an int field called 'Deployment Order'
On the sys_relationship table, create a new record called 'Update Sets. The 'Applies to table' value will be Story[rm_story] and the 'Queries from table' value will be Update Set[sys_update_set].The code that creates the relationship:
```
(function refineQuery(current, parent) {
//Get Story number
var storyNum = parent.getDisplayValue('number');//Query Update Set table for matching story number values
current.addEncodedQuery('state=completeu_story_number=' + storyNum + 'ORDERBYu_deployment_order');
})(current, parent);
```
Form:
3. The last step is to add this relationship to your Story view - in our case the Scrum view. I chose to add a new Section to the form through the Form Configuration menu option. From there, select your new 'Update Sets' section and move your newly created relationship to 'selected'.
Final Result:
Hopefully this is helpful for others. Let me know if there are any questions or recommendations!
Labels:
https://www.servicenow.com/community/developer-articles/linking-update-set-to-agile-story/ta-p/2322425
