Can't get Spint ID and end date using lookupissues in JIRA automation

Kavita Patil December 2, 2024

Hi All,

I want to automatically send an email to users a day before the sprint ends that they need to close the JIRAs. I have created JIRA automation to lookup issues with JQL "spint in openSprints() AND status != Done AND project = "my project name". After that when I create a compare condition, with 

 

({{lookupIssues.first.sprint.endDate.jiraDate}} equals {{now.plusDays(1).jiraDate}}) and send email based on this condition, email is not sent. If I try to just skip the comparison and send email with 

 

({{lookupIssues.first.sprint.endDate.jiraDate}} and 

 

({{lookupIssues.first.sprint.id}} in the subject, I do not get any values. 

How can I get these values if my context is not the triggers, Sprint Created, Sprint Completed or Sprint Started?

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hello @Kavita Patil 

Welcome to the Atlassian community.

Whenever you ask for help with an Automation Rule it will help us to help you if you provide:

  1. screen images that show your entire rule,
  2. screen images showing the details of the step(s) that aren't generating the result you expect
  3. screen images showing the Audit Log details for the rule execution
  4. screen images showing the relevant data in an image that is part of the rule execution

Can you provide a screen image that shows the content of the Sprint field for one of the issues that is returned in the Lookup Issues results? What I am hoping to discover is if the issue(s) have been associated to multiple sprints. If they were associated to a sprint in the past, and were not completed in that sprint and not removed from that sprint, then the Sprint field will have multiple values. Trying to get the sprint date information for a specific sprint within the Sprint field is then more complex.

Kavita Patil December 3, 2024

DayBeforeSprintEndEmail.pngAuditLogWithoutEmailSent.png

Kavita Patil December 3, 2024

As you can see from the log the email is not sent. If I remove the condition the email gets sent, but the sprintId and enddate do not show up in the email. It just shows the following in the email. "Close Sprint JIRAs by EOD"

Kavita Patil December 3, 2024

DateConditionRemovedAuditLog.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2024

Thank you for that additional information.

Can you provide a screen image that shows the content of the Sprint field for one of the issues that is returned in the Lookup Issues results? 

What emails are you trying to generate? Are you trying to generate one email per sprint, or an email per assignee, or ...?

 

Note that based on your images you are using Jira self-hosted - Data Center or Server, but you added tags to your post that say "cloud". You are not using the "cloud" (Jira software-as-a-service) product.

Additionally, you posted this in the Jira Service Management forum. Are these issues in a Jira Service Management project, or are they in a Jira Software project?

Kavita Patil December 3, 2024

I am sorry I can't share the actual JIRA content as it is related to my work. I am trying to generate one email that gets sent to a group of people. This is just a reminder telling the group to close the JIRAs before then end of the sprint. I have verified that the list of the JIRAs returned by lookupissues has sprint assigned to it.

I will update the forums. I was not sure what to put there. Thanks for your help. I do not see how I can move it to a different forum. Do I need to repost to the right forum?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2024

Looking at the documentation, it appears that the Sprint field is available as an attribute of issues only when one of the Sprint triggers is used for the rule.

https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html

Screenshot 2024-12-03 at 2.37.13 PM.png

I also tried in my own data center instance using both the field name (sprint) and the custom field ID. Both generated no output in the log when trying to reference {{lookupIssues.first.sprint}} or {{lookupIssues.first.customfield_#####}}

I haven't worked out the details but you could perhaps use the Send Web Request action to make a call to the Jira API to get the agile info, such as Sprint, associated to the first issue in the list.

https://developer.atlassian.com/server/jira/platform/rest/v10000/api-group-issue/#api-agile-1-0-issue-issueidorkey-get

You would have to parse the output to get the sprint information out of it.

Kavita Patil December 3, 2024

Thanks for your help. I will use the APIs

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events