How to auto populate custom reference field value into another reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 09:57 PM
Hello Experts,
I have created one catalog item in that Cat item workflow I created task 1 and task 2
My requirement is
I have created one custom attribute((Responsible assignment group) referenced to groups table) it will visible only in task 1(created UI policy on sc_task table the condition is short description is ABC).
Now I want to populate Task 1 custom field value in Task 2 Assignment group field.
How to achieve this
Best regards,
Nani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 10:44 PM
Create an after update BR on task table, the condition. should be like:
1. request_item.cat_item = "your catalog item"
2. short_description="" // short description of your 1st task
in the script field add below:
var task = new GlideRecord('sc_task');
task.addQuery('request_item',current.request_item);
task.addQuery('sys_id', "!=", current.sys_id);
task.query();
while(task.next())
{
task.assignment_group = current.custom_field;
task.update();
}
Please mark the answer correct/helpful accordingly.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 10:49 PM
Hi @Nani18 ,
You can use use Workflow Scratchpad variable to store the Custom Assignment Group in Task1 which you can use/retrieve in Task 2 to Activity.
Use this in Task1 Activity
workflow.scratchpad.variableName = variableValue;
Where variableValue will be the reference of group.
And then you can use it in Task2 to assign it to Assignment Group.
Mark Correct or helpful if it helps you.
Thanks & Regards,
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 11:27 PM
Hello @Uday Soni05
In task 2 workflow activity which script I need to use...?
Could you please share me the script.
Regards,
Nani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 11:53 PM
Hi @Nani18 ,
You can use it like in your script in Task2 activity
task.assignment_group = workflow.scratchpad.variableName;
workflow.scratchpad.variableName which you created in Task 1 activity
Regards,
Uday