How can we replicate Asset Action Swap CI functionality of Incident to Catalog Task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 01:50 PM
How can we replicate Asset Action Swap CI functionality of Incident to Catalog Task?
We can see Affected CI Tab having Asset Action Swap CI functionality of Incident Table.
Can we replicate the same for Catalog Task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello VIKAS45
Did you find a way to implement this? I see some business rules and ACLs that would need to added
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
You need to create new acls for the asset_action and swapped_ci fields on [affected_ci] so that they can be read and edited. Then you just need business logic to queue the sn_hamp.asset.* events. The AssetAutomationAPI that does the ci updating does not care about the task type so you don't need to touch the script actions.
You can't use the ITSMCommonHAM script include without edits as it takes the user value from the caller_id field available on incident or change_request so either update the sendActionEevent method of ITSMCommonHAM SI or create a new one.
You can test it by running this in background scripts, just swap the sysids to valid ones.
var grScTask = new GlideRecord("sc_task");
if (grScTask.get("99ff356228c25110f877fb6dabcf174e")) {
gs.eventQueue("sn_hamp.asset.swap",
grScTask,
JSON.stringify({
"oldCIId": "46c12959a9fe1981009955ab1fa64226",
"newCIId": "e9a9280d3790200044e0bfc8bcbe5d8c",
"userId": gs.getUserID()
})
)
}
