copy the description of a scrum task to another scrum task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2023 03:01 PM
Hi! I'm working on a workflow where there is a story. The story has several scrum tasks and I need the description of the first scrum task to be copied with scripting to the description of the second scrum task.
I'll be leaving a screenshot of the work flow and the code I have so far, which is not copying anything.
Thanks in advance!
var parent = current.sys_id;
task.parent = parent;
// Get the sys ID of the story
var storySysId = parent;
// Get the sys ID of the first and second tasks
var firstTask = new GlideRecord('rm_scrum_task');
firstTask.addQuery('story', storySysId);
firstTask.orderBy('sys_created_on');
firstTask.query();
if (firstTask.next()) {
var firstDescription = firstTask.description.toString();
}
var secondTask = new GlideRecord('rm_scrum_task');
secondTask.addQuery('story', storySysId);
secondTask.orderByDesc('sys_created_on');
secondTask.query();
if (secondTask.next()) {
secondTask.description = firstDescription;
secondTask.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 01:59 AM
Thanks @Ankur Bawiskar . No, I´m not sure. I'll double check. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 02:05 AM
write this in story table with below script-
var chgID = current.sys_id.toString();
var tasks = new GlideRecord('rm_scrum_task');
tasks.addQuery('story', chgID);
tasks.query();
while (tasks.next()) {
var taskID = tasks.sys_id.toString();
current.description = tasks.description;
tasks.update();
please mark my answer correct and helpful if it helps you