Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Values Logic to Compare Two JQL Results and Find Non-Logging Users

Venkatesh G June 16, 2025

 

Background

I'm trying to create an automation that identifies team members who haven't logged work for the previous day and sends a notification to Microsoft Teams.

Current Setup

JQL Query 1 - All Sprint Assignees

 

jql
project = Digi and Sprint in openSprints() and issuetype IN (Sub-task, Task, Bug)

 

Smart Value Used: {{lookupIssues.assignee.accountId.distinct}}
Variable Name: allAssignees
Purpose: Get all users assigned to issues in active sprints

JQL Query 2 - Users Who Logged Yesterday

 

jql
project = Digi and Sprint in openSprints() and issuetype IN (Sub-task, Task, Bug) and worklogDate = -1d

 

Smart Value Used: {{lookupIssues.worklog.author.accountId.distinct}}
Variable Name: loggedAssignees
Purpose: Get users who logged work yesterday

What I Need Help With

I need to:

  1. Compare the two arrays (allAssignees vs loggedAssignees)
  2. Find users who are in allAssignees but NOT in loggedAssignees
  3. Send the list of non-logging users to Microsoft Teams

Questions

  1. How can I perform array comparison in Smart Values? Is there a way to find the difference between two arrays of account IDs?
  2. What's the best approach for this logic? Should I:
    • Use conditional logic with {{#if}} statements?
    • Iterate through one array and check against the other?
    • Use a different Smart Values function I'm not aware of?
  3. How do I convert account IDs back to display names for the Teams message?

Desired Output

A Teams message like:

 

⚠️ Daily Timesheet ReminderThe following team members haven't logged work for yesterday:- John Doe- Jane Smith



1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2025

Hi @Venkatesh G 

Please see my response to a similar question which uses a dynamic regular expression to find the difference between two lists of values:

https://community.atlassian.com/forums/Automation-questions/Re-How-can-I-compare-two-smart-value-arrays-and-return-o/qaq-p/3041765/comment-id/14435#M14435

Kind regards,
Bill

Venkatesh G June 17, 2025

Dear @Bill Sheboy 

I tried understanding it, but it is more complex for me to understand as per my needs. Can you explain it as per my requirement ?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2025

That linked post and this article explain the steps:

https://community.atlassian.com/forums/Automation-articles/Automation-concepts-Find-Overlaps-Between-Lists/ba-p/3045704

 

Please show what you have tried thus far to solve this for your rule, and explain what is not working as expected.  That will provide more context to offer suggestions.

From your original question, the likely variation is because you are storing the account ID lists as variables they are text and not lists of values.  They must be first split() into lists before proceeding with the steps, such as with:

{{allAssignees.split(", ")}}

 

Venkatesh G June 18, 2025

Thanks @Bill Sheboy . Hereby i am enclosing screenshots and the steps i have achieved as of now . 

 

As mentioned first, I have checked all assignees in the sprint using JQL and stored it in Variable "allAssignees"

 

Screenshot 2025-06-18 at 9.14.02 AM.png

 

Followed by i am checking the users who has logged on previous day

Screenshot 2025-06-18 at 9.14.14 AM.png

 

 

Screenshot 2025-06-18 at 9.14.42 AM.pngScreenshot 2025-06-18 at 9.14.53 AM.png

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2025

TIP: When diagnosing rule problems, use the Log action to write values to the audit log for later investigation.

 

Using log writes you would find three problems, including where your scenario is different than the article I showed:

  • Your variable is named allAssignees, but you have added a space in the name later, making it not match.
  • In the match() you are not using the regular expression, varRegEx
  • There can be multiple worklogs for a work item.  And so when using the results of the second result there are nested lists within lists, such as:
{{lookupIssues}}
here is the first work item, and it contains a list of worklogs as
here is a log record, with an author,
 here is another log record, with an author,
...
here is the second work item, and it contains a list of worklogs as
here is a log record, with an author,
 here is another log record, with an author,
...
...
{{/}}

 

And so your worklog author list needs to be flattened into a single list before distinct is used:

  • create variable: 
    • variable name: loggedAssignees
    • smart value: {{lookupIssues.worklog.author.accountId.flatten.distinct}}

 

Please try removing the space from allAssignees and use the regular expression in the match function.

Venkatesh Parthiban_G
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2025

Dear @Bill Sheboy 

Thanks for the suggestion. Using this i have received the values that matches both the lookup table which is logged assignees and All Assignees.

 

But how can i find the values that are available in allAssignees but not in logged Assignees ?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2025

Hi @Venkatesh Parthiban_G 

Please see the variations in the article I wrote for how to find the differences (or remove items) from one list based on another:

https://community.atlassian.com/forums/Automation-articles/Automation-concepts-Find-Overlaps-Between-Lists/ba-p/3045704

If after you try that it still does not work, please post images of your updated rule, each of the steps, and of the audit log details showing the rule execution.

Thanks!

Venkatesh Parthiban_G
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2025

Dear @Bill Sheboy ,

Thanks. This really resolved my long time search. Thanks a ton.

While sending message in teams chat, can we tag the users ?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2025

Awesome; I am glad to learn it is working!  Please consider marking this question as "answered" to help others with a similar need find solutions faster.  Thanks!

 

Regarding the user message in MS Teams, I do not know that answer.  If there is a separate ID per user (as with Slack) you would need that user's ID to mention them.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events