- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 09:41 AM
Hi,
I'm configuring an indicator source with table task_sla. The condition, "Task. Closed on Today" is already present in the condition builder. I'd also like to add a condition that shows tasks resolved today (Task. Resolved on Today), but it's not an option.
How do I add this?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 11:18 PM
Hi @JordyZ ,
The resolved on today is not on the task table, but instead e.g. on the incident table. You therefor need to dot-walk to the correct table to get the "resolved on today". See example below:
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 10:15 AM
Hi,
Based on the information you've provided and the description in the image, the "Task. Resolved on Today" condition isn't a pre-built option in the condition builder for indicator sources using the task_sla table. However, you can achieve the desired functionality using a custom script within the condition builder.
Here's how to create a condition to show tasks resolved today:
- Access the Condition Builder: In your indicator source configuration, navigate to the condition builder where you're defining conditions for the tasks.
- Add Script Condition: Click the "+" button and select "Script" from the available condition types.
- Write the Script: Within the script editor, enter the following code:
current.closed_at.getDisplayValue() === gs.TODAY()
Explanation of the Script:
- current.closed_at refers to the "Closed At" field of the task record.
- getDisplayValue() method retrieves the human-readable date format of the "Closed At" field.
- gs.TODAY() is a ServiceNow function that returns the current date in YYYY-MM-DD format.
- The comparison (===) checks if the displayed value of the "Closed At" field matches the current date.
- Save and Test: Save the condition and test your indicator source to ensure it correctly identifies tasks resolved today.
Thanks
Aravind Panchanathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 10:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 10:31 AM - edited 03-08-2024 10:37 AM
Hey @JordyZ - The location of the "+" button to add a script condition in ServiceNow might vary slightly depending on the specific version you're using. Here are two common scenarios to help you find it:
Scenario 1: Classic UI
- In your indicator source configuration, navigate to the section where you define conditions for tasks (often labeled "Conditions" or "Condition Builder").
- Look for a section with existing pre-built conditions. This section might display a list of available conditions or a visual builder with connected elements.
- Within this section, locate a button bar or toolbar. You should see buttons for adding and manipulating conditions.
- The "+" button you're looking for could be a simple plus sign (+), a button labeled "Add", or a button with an icon representing adding elements.
Scenario 2: ServiceNow Now Platform UI
- Access your indicator source configuration in the Now Platform UI.
- Locate the section for defining conditions, which might be labeled "Conditions" or "Condition Builder.
- This section usually displays a panel or a builder interface where you can visually construct conditions.
- Look for options to add new conditions. This could be a dedicated button labeled "Add Condition", a dropdown menu with options like "Add Condition", or a plus sign (+) within the builder itself.
Tips:
- If you're unsure about the exact location, try hovering your mouse over buttons in the condition builder section. Tooltips might appear indicating the button's function.
- Consult your ServiceNow documentation or search online for specific guidance on the UI for your version.
- If you still have trouble finding the script condition option, consider contacting your ServiceNow administrator for assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 11:18 PM
Hi @JordyZ ,
The resolved on today is not on the task table, but instead e.g. on the incident table. You therefor need to dot-walk to the correct table to get the "resolved on today". See example below:
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/