Skip to content

Conversation

@vhudlikar
Copy link
Contributor

This is a Action that handles the tag creation part of the feature. #8

Inputs needed for this action.

  • URL
  • Title
  • User or List of User's

Logic:

  1. Upsert Logic (Update or Insert): The action checks for an existing favorite record in the sys_ui_bookmark table based on the combination of User and URL.
  2. If Found: The existing record's Title is updated to match the input, ensuring consistency.
  3. If Not Found: A new sys_ui_bookmark record is created.
  4. Batch Processing: The Script Step efficiently iterates over the input users_list, handling single users or arrays of users.

Outputs:

  • Returns created_count, updated_count providing transparency on the batch operation's success.

Testing Scenarios:

Scenario Input Configuration Expected Outcome Verification
1. New Insert (Single User)
  • Users: [Abel Tuter]
  • Title: New Dashboard Link
  • URL: my_dashboard.do
1 record inserted. created_count = 1. updated_count = 0. Check sys_ui_bookmark.list for the new record.
2. Batch Insert (Multiple Users)
  • Users: [Abel Tuter, Beth Anglin]
  • Title: Team P1 Report
  • URL: report_viewer.do?sys_id=123
2 records inserted. created_count = 2. updated_count = 0. Query sys_ui_bookmark to confirm both users have the record.
3. Existing Record Update
  • Pre-condition: Run Scenario 1 first.
  • Users: [Abel Tuter]
  • Title: Updated Dashboard Title
  • URL: my_dashboard.do (Same URL)
1 record updated. created_count = 0. updated_count = 1. Check the existing record for Abel Tuter; the title field must be updated.

vhudlikar and others added 5 commits October 2, 2025 11:39
…ature.

Logic:
1. Check if a tag with the provided Tag Name already exists in the label table.
2. If it does not exist, create a new tag record with that name. 
3. Return the Sys ID of the newly created tag. 
4. If the tag already exists, it should likely not create a duplicate but instead return the Sys ID of the existing tag by setting tag as active.
@github-actions
Copy link

github-actions bot commented Oct 3, 2025

Valid PR for ActionPack

Thank you for your contribution. This PR complies with the CONTRIBUTING.md.
A maintainer will review this shortly. In the meantime, Happy Hacking!

@niamccash niamccash self-assigned this Oct 3, 2025
@niamccash niamccash merged commit 010c6eb into ServiceNowDevProgram:main Oct 3, 2025
2 checks passed
@niamccash
Copy link
Contributor

Thank you for your contribution!
Closes #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants