- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 05:04 AM
hi ,
i have requirement for copy variables to task description.
i have workflow for that item
Kindly help.
Thanks,
BK
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 05:11 AM
I was able to achieve this using run script activity
i have wrote below script in activity
var sctask = new GlideRecord("sc_task");
sctask.addQuery("request_item", current.sys_id);
sctask.query();
if (sctask.next()) {
gs.print(sctask.request_item);
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(sctask.request_item);
set.load();
var vs = set.getFlatQuestions();
workflow.scratchpad.description= '';
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && vs.get(i).getDisplayValue() != 'false') {
workflow.scratchpad.description= workflow.scratchpad.description+ vs.get(i).getLabel() + " : " + vs.get(i).getDisplayValue() + "\n";
}
}
}
then in catalog task activity in advance script
task.description=workflow.scratchpad.description;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 05:07 AM
Hi @Bhavya11 in the workflow in catalog task activity
add can add it in the below script format.
task.description=current.variables.name1+' '+current.variables.name2;
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 05:11 AM
I was able to achieve this using run script activity
i have wrote below script in activity
var sctask = new GlideRecord("sc_task");
sctask.addQuery("request_item", current.sys_id);
sctask.query();
if (sctask.next()) {
gs.print(sctask.request_item);
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(sctask.request_item);
set.load();
var vs = set.getFlatQuestions();
workflow.scratchpad.description= '';
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && vs.get(i).getDisplayValue() != 'false') {
workflow.scratchpad.description= workflow.scratchpad.description+ vs.get(i).getLabel() + " : " + vs.get(i).getDisplayValue() + "\n";
}
}
}
then in catalog task activity in advance script
task.description=workflow.scratchpad.description;