- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 04:10 PM
Hello fellow Admins,
I received a request to configure an Assign to Me button for fulfillers on the SCTASK record. How would I do this to mimic the action and design of what is available on the INC form?
See examples below.
CURRENT Incident Form > Service Operations Workspace | CURRENT Catalog Task (SCTASK) Form > Service Operations Workspace |
|
|
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 03:17 AM
I am not coder 😤 but can help you more. I saw OOTB this button available on Change task
Have a look on same
https://INSTANCENMAE.service-now.com/now/nav/ui/classic/params/target/sys_ui_action.do%3Fsys_id%3D3987cbbe23003300a282fa9e27bf655c%26sysparm_record_target%3Dsys_ui_action%26sysparm_record_row%3D1%26sysparm_record_rows%3D7%26sysparm_record_list%3DnameSTARTSWITHAssign%255EtableCONTAINStask%255EORDERBYorder
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 11:00 AM
The following UI action (copied from "Assign to me" defined on the change_task table) worked for me:
Appears on the sc_task form. Maybe this will work for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 02:13 PM
Follow Below Process
1.Navigate to UI Actions in the backend. Filter Assign to me button for sc_task , Open the record
2.Scroll to the bottom of Ui action and check the workspace related checkboxes, and add the script in the script field.
function onClick(g_form) { assignToMe(); function assignToMe() { g_form.setValue("assigned_to", g_user.userID); g_form.submit(g_form.getActionName()); } }
Let me know if you need any more help
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 06:10 PM
Thank you all for your assistance!!!!
I was able to take suggestions from everyone who replied, and I added a few additional steps to successfully configure the "Assign to Me" button on the classic and Service Operations Workspace task record.
See the full steps below.
(function() { var assignedToFieldLabel = sys_meta[current.getRecordClassName()]["assigned_to"].label; if (!current.assigned_to.canWrite()) { gs.addErrorMessage(gs.getMessage("You do not have permission to update the {0} field", [assignedToFieldLabel])); return; } if (!current.assignment_group.nil() && !gs.getUser().isMemberOf(current.assignment_group.toString())) { gs.addErrorMessage(gs.getMessage("{0} user must be a member of the \"{1}\" group ", [assignedToFieldLabel, current.assignment_group.getDisplayValue()])); return; } current.assigned_to = gs.getUserID(); current.update(); })();
Step Number | Description | Example |
1 | I looked up the existing "Assign to Me" UI action related to the Change Table. Table: Type sys_ui_action.list in the All Menu. |
|
2 | I opened the Change able record and used the "Insert and Stay" function to copy the record and renamed it "Assign to me (SCTASK)". |
|
3 | I opened the new "Assign to me (SCTASK)" record and made the following changes:
Top Half 1. Action name changed to sctask_assign_to_me. 2. Checked the following boxes: - Active - Show insert - Show update - Form button - List context menu Bottom Half - Workspace For Button-see step 4-Format for Configurable Workspace |
|
4 | I inputted the following code within the Workspace Client Script field: |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2024 02:13 PM
Follow Below Process
1.Navigate to UI Actions in the backend. Filter Assign to me button for sc_task , Open the record
2.Scroll to the bottom of Ui action and check the workspace related checkboxes, and add the script in the script field.
function onClick(g_form) { assignToMe(); function assignToMe() { g_form.setValue("assigned_to", g_user.userID); g_form.submit(g_form.getActionName()); } }
Let me know if you need any more help
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 06:10 PM
Thank you all for your assistance!!!!
I was able to take suggestions from everyone who replied, and I added a few additional steps to successfully configure the "Assign to Me" button on the classic and Service Operations Workspace task record.
See the full steps below.
(function() { var assignedToFieldLabel = sys_meta[current.getRecordClassName()]["assigned_to"].label; if (!current.assigned_to.canWrite()) { gs.addErrorMessage(gs.getMessage("You do not have permission to update the {0} field", [assignedToFieldLabel])); return; } if (!current.assignment_group.nil() && !gs.getUser().isMemberOf(current.assignment_group.toString())) { gs.addErrorMessage(gs.getMessage("{0} user must be a member of the \"{1}\" group ", [assignedToFieldLabel, current.assignment_group.getDisplayValue()])); return; } current.assigned_to = gs.getUserID(); current.update(); })();
Step Number | Description | Example |
1 | I looked up the existing "Assign to Me" UI action related to the Change Table. Table: Type sys_ui_action.list in the All Menu. |
|
2 | I opened the Change able record and used the "Insert and Stay" function to copy the record and renamed it "Assign to me (SCTASK)". |
|
3 | I opened the new "Assign to me (SCTASK)" record and made the following changes:
Top Half 1. Action name changed to sctask_assign_to_me. 2. Checked the following boxes: - Active - Show insert - Show update - Form button - List context menu Bottom Half - Workspace For Button-see step 4-Format for Configurable Workspace |
|
4 | I inputted the following code within the Workspace Client Script field: |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 01:34 AM
Good to know @Xavier_Wharton
If you think we all help , please accept answer as solution to motivate all.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************