- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 02:27 AM
Hi Community,
I want to change the value of CI state from abc to xyz selected on the CI list collector field of a catalog item using workflow.
This is what i did so far.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 11:12 PM
Hi,
Use below script:
var CIList = current.variables.server_name_s.toString();
var grCI = new GlideRecord('cmdb_ci_computer');
grCI.addEncodedQuery('sys_idIN' + CIList);
grCI.query();
while (grCI.next()) {
grCI.operational_status = 1;
grCI.update();
}
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 10:54 PM
I am doing same. Using run script after approval but first catalog task activity is there. If i didnt check the wait for completion checkbox under this activity it will not complete and in the show workflow its showing its proceeding further and completing the workflow but its not updating anything.
Here is the snap of my workflow.
Also the approvals are getting created on ritm table instead of sc task.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 11:18 PM
Yes,
The workflow is running on requested Item so it will create approval on sc_req_item table not sc_task.
Is your run script activity running?
Also put some logs to check if it is finding any CI or not.
Share configuration of your list collector variable, to which table it is referring?
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 12:39 AM
Yeah that i know but as per my requirement i want it on sc task table. Run script activity is running i checked it using show workflow. The list collector variable is referring on cmdb_ci table only.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 01:44 AM
If you want approval on sc_task then Approval Activity will not work, you need to use run script to trigger approval and wait for condition to wait until approval is processed.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 08:01 PM
This code is not working. Its not doing anything.