- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 06:37 AM
Hi,
I'm trying to get the Task assigned_to name from a Task and paste the name to another Task work notes.
Ex.: From Task 1, I want to get the Task assigned_to name and then paste the name to the Task3 work notes
I tried with that script in
Task1
workflow.scratchpad.task1 = task.assigned_to;
Task3, but it paste me the assigned_to name of the previous Task (Task 2)
var gra = new GlideRecord('sc_task');
gra.get(workflow.scratchpad.task1);
var assignee = gra.assigned_to.getDisplayValue();
I need your lights!
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 11:00 AM
I resolved my issue.
I made a change to the Task1:
workflow.scratchpad.task1 = task.setNewid();
Modified Task2 and Task4 by using workflow.scratchpad.task2
Task3:
var gra = new GlideRecord('sc_task');
gra.get(workflow.scratchpad.task1);
assignee = gra.assigned_to;
use assignee.getDisplayValue() in the work notes
now all Tasks work as expected
Thanks for help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 07:45 AM
Hi @Andre6,
From task 1 can you use display value directly instead of using GlideRecord to get it in task3?
Task 1
workflow.scratchpad.task1 = task.assigned_to.getDisplayValue()
Task 3
Use workflow.scratchpad.task1 directly to set worknotes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 08:00 AM
Hi Monikay94,
Thanks, I like the fact that it uses less scripting, but it still gives the same issue.
I'm not getting the Task1 assigned_to name but it picks the Task2 assigned_to name.
Both tasks are not assigned to the same team/member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 08:16 AM
Is task assigned_to is hard coded?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 08:21 AM
I don't know
I see that it paste the user sys_id from the Task2, but if I add the .getDisplayValue(), I see the name
But I don't know how the Task assigned_to settled
I see this if I select show "assigned_to"