Copy the Short description from RITM to Short Description on SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2024 04:47 PM
Hello,
I have a flow where I am trying to copy the content of the Short description and description fields from the RITM to the Short description and description fields on the SCTASK in flow designer. I have been able to do this when using Workflow in previous catalog items, but it doesn't seem to work the same in Flow Designer.
This is an example of the script I us on the SCTASK on the workflow. How can I best tweak this so it will work in the SCTASK on a flow?
EXAMPLE SCRIPT
// Update task description with RITM short description
// For example:
task.short_description = current.short_description;
if(current.cat_item == 'ddbca057973202101329f6fce053af16')// Name Change Cat Item
{
task.short_description = "Review user details and confirm with user - "+current.short_description;
task.description = current.description;
}
Thanks in advance for any help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2024 05:52 PM
It lets me save it with no error but as soon as I try to activate the flow I get the same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 07:26 AM - edited ‎07-31-2024 02:01 PM
Hello @riskay123 ,
To get the RITM data, we have to use fd_data.trigger.request_item.<variable name>. Try the below updated code.
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**Order number is offset by +1 in Error Handling Section.
**Available options display upon pressing "." after fd_data
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var shortDesc = fd_data.trigger.current.short_description;
if(fd_data.trigger.request_item.cat_item == 'ddbca057973202101329f6fce053af16'){
shortDesc = "Review user details and confirm with user - "+shortDesc;
}
return shortDesc;
Thanks,
Alka

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 01:59 PM
Can you try below code?
var shrt = fd_data.trigger.request_item.short_description; // gets short description of RITM
var desc = fd_data.trigger.request_item.description; // gets description of RITM
shrt = fd_data.trigger.current.short_description; //short description field on SCTASK
desc = fd_data.trigger.current.description; // description field on SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2024 07:56 AM
Hi @riskay123
Do you have any flow linked to the catalog item?
If yes then you should use 'Create Catalog task' in your flow, This is similar to 'Catalog task' Activity Available on Workflow.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP