- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2019 03:58 AM
Is there any way to update workflow activities of existing workflows via script? we have a requirement to update the value of assignment group in all the activities(catalog task/ approval group) where specific group is used.
Regards,
Mandeep
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2019 08:32 AM
Hi there,
Technically: Yes. Open the wf_activity table, filter for your workflow, activity definition "Run Script", and filter on the name (if it didn't change over time). You could get an overview like below example. Just look for the published record. The record contains a "script" field with the actual script. Technically you could just update this. Also thru a Fix Script, Background script, etc..
This might also be a nice opportunity to not just change the hardcoded sys_id (which is not best practice) but for example use a system property.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2019 08:32 AM
Hi there,
Technically: Yes. Open the wf_activity table, filter for your workflow, activity definition "Run Script", and filter on the name (if it didn't change over time). You could get an overview like below example. Just look for the published record. The record contains a "script" field with the actual script. Technically you could just update this. Also thru a Fix Script, Background script, etc..
This might also be a nice opportunity to not just change the hardcoded sys_id (which is not best practice) but for example use a system property.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2019 01:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2019 01:51 AM
Yes you are correct. In the popup the script field is shown, though actually the script field is stored in the Values table [sys_variable_value].
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2019 04:56 AM
Thank you!