- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 12:07 PM
As far as the script itself, each time it runs it is going to create one sc_task record for each record in your u_catalog_workflow_activities table retrieved. You could add a log to the script if you are uncertain how many records the GlideRecord is retrieving. If the workflow is where you removed a loop, have you confirmed that there is now only one path to this Run Script activity, and are you testing with a newly-created record? Existing requests will continue to use the workflow as it existed when the request was created.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 12:28 PM
What is happening is when we create a Service Catalog request from the workspace, it generates multiple tasks. I initially thought it was the UI action, but when I removed this workflow with a flow designer flow, we didn't have an issue. The problem is that this workflow is used for multiple catalog items like over 70 plus items. We need to fix it.
I did. I refreshed and created a new interaction, but same issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 12:34 PM
Do you know how many records the GlideRecord on your fulfillment table is retrieving in your test case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 08:36 AM - edited 11-26-2024 09:03 AM
Actually, it is at the Fulfillment table is retrieving more than one record. Maybe I should use an encoded query instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2024 09:36 AM
That could work, though it would be harder to incorporate the conditional addQuery if the sequence is not blank. Manually filter a list view on your table by the criteria, selecting the cat_item and sequence number used in your test case to see how many rows are returned, then tweak it to return the expected rows. If the query should return multiple records but you only want to create one Catalog Task record, you can change the while to if.