oon catalog task creating ui actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 02:38 AM
In request item whenever short description starts with QA and user is from hardware group then show ui action button on catalog task whenever user click the button catalog task state should be closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 02:49 AM
Hi @kandunurimahesh ,
I trust you are doing great.
- Create a UI Action:
- Navigate to "UI Actions" in the ServiceNow application.
- Click on "New" to create a new UI action.
- Provide a name for the UI action, such as "Close Catalog Task."
- Set the Table to "Catalog Task."
- In the "Advanced" section, select "Show Insert/Update" to display the UI action button on the form.
- In the "Action" field, enter the following JavaScript code:
if (current.short_description.startsWith('QA') && current.assignment_group.name === 'Hardware Group') {
gs.addInfoMessage('Clicking this button will close the catalog task.');
current.state = 3; // 3 represents 'Closed Complete' state
current.update();
}
Add Conditions to the UI Action:
- In the "Conditions" section of the UI action form, add the following conditions:
- Table: Request Item
- Action Name: Insert
- In the "Conditions" section of the UI action form, add the following conditions:
Save the UI Action and Test:
- Click on "Save" to save the UI action.
- Go to a Request Item form where the short description starts with "QA" and the user is assigned to the "Hardware Group."
- You should now see the UI action button labeled "Close Catalog Task."
- When clicked, it will close the associated catalog task and display a message indicating the action has been performed.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 11:46 PM
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 02:52 AM
Create a ui action on ritm with the following condition
currrent.short_descripotion.startsWith('QA') && gs.getUser().isMemberOf('<Group name or sys_id>')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2023 11:47 PM
Thank you