update description of a task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello All ,
Due to a business need , i'm trying to update the description of a task in sc_task .
I have created a Dynamic activity linked to this task .
The problem is ; in the condition to the GlideRecord i have added the sysid of the task , but i have no records .
However , when i run the same script in a background manually , everything is OK .
I have added a sleep (Maybe the sc_task is not updated when the script is running) and i still have the same result .
Could you please help me on this topic ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Greetings @KouassiP. Where is "ritmSysid" and "taskSysID" being declared? I do not see them in your script? Have you tried using the .getUniqueValue() method instead? I will include a link to ServiceNow documentation below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
In addition to "ritmSysid", "taskSysID", "SHDES", and "DES" not being defined in the script that you posted, you have logic errors / extraneous code. You don't want or need the sleep, and in the first GlideRecord since you want to return a record with a specific sys_id, wherever you are getting that from, you don't need the 'parent' addQuery line as there is already only one record with that sys_id. If you want to update the fields with certain values if the parent is populated, and other values if the parent is not populated then do that in the same GlideRecord in an IF block, but as written you're setting the fields to the same (undefined in this case) values in both GlideRecords. It would help if you describe and show where and how you are using this so we have some context.