Forums

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

Can you have JQL Branch Rule Use Issue Function

Steve Tedeschi
Contributor
April 17, 2025

I am trying to create an automation the identifies the number of issues and their Story Point sum that have been added / removed from a sprint; i.e., my JQL is

issueFunction in removedAfterSprintStart("{{boardName}}", {{sprintId}}) AND (labels is EMPTY or labels not in(Placeholder))
issueFunction in addedAfterSprintStart("{{boardName}}", {{sprintId}}) AND (labels is EMPTY or labels not in(Placeholder))

 

This is project-scope automation and, while the Board filter does include issues from a second project, I am only interested in the tickets in the same project
* Board filter includes issues in ProjectA and ProjectB
* Automation is in ProjectA and I am only interested in ProjectA issues

No results are returned when the automation fires based on a trigger (eg Sprint closed)

Results are returned when scheduled and manually triggered. This, unfortunately, means I need to update the sprintId variable and manually trigger at each sprint close.

 

Any thoughts why the JQL wouldn't return results when automatically triggered?

1 answer

0 votes
Trudy Claspill
Community Champion
April 17, 2025

Hello @Steve Tedeschi 

Can you provide screen images that show your entire rule?

And can you provide images of what is written in the rule's audit log when it executes?

 

Steve Tedeschi
Contributor
April 18, 2025

@Trudy Claspill Sure - please see attached

Jira Log.pngJira Rule.png

Trudy Claspill
Community Champion
April 18, 2025

Thank you for that additional information.

You said that your rule was triggered by an event like Sprint Closed, but the rule image you shared does not use that trigger. 

Can you share images of the rule when you use that trigger, and the output in the rule audit log when such a rule executes?

Also can you provide the details of the Create Variable actions, please?

I would also suggest that you should add Log actions to print into the rule audit log the value of each Variable that you created to confirm it has the value you think it should.

Like Bill Sheboy likes this
Steve Tedeschi
Contributor
April 21, 2025

@Trudy Claspill - Hoping I answer your questions....

  • Trigger: Yes, the original automation was triggered by the sprint close event. I originally thought it was a timing issue and switched it to be triggered by commenting on a specific issue (also easier to test / trigger the automation. Here is the original rule and log. You can see that search result was empty.
    Jira Rule Sprint Close Event.png
  • Variables: Variables are used so that the automation can easily be exported / imported into different projects, allowing us to change the project key, sprint event (issues added / removed from sprint), etc. They are used to build the JQL executed in the automation; i.e., 
    • issueFunction in removedAfterSprintStart("{{boardName}}", {{sprintId}}) AND (labels is EMPTY or labels not in(Placeholder))
    • issueFunction in addedAfterSprintStart("{{boardName}}", {{sprintId}}) AND (labels is EMPTY or labels not in(Placeholder))
  • Log Values: I had been using email contents for this purpose; can switch to logging values.

 

Steve Tedeschi
Contributor
April 21, 2025

FYI - I've even tried moving the JQL from dynamic to calling a filter which executes the same JQL. Unfortunately, same result. No results found.

Trudy Claspill
Community Champion
April 21, 2025

Thank you for the additional information.

Can you share the details of the Create Variable actions, so that we can see what you are using to set the variables?

I would also suggest that you should add Log actions to print into the rule audit log the value of each Variable that you created to confirm it has the value you think it should.Screenshot 2025-04-21 at 9.01.35 AM.png

Steve Tedeschi
Contributor
April 23, 2025

My goal is to automate capturing sprint metrics across development teams so they can be reported in aggregate. Metrics include number of issues and sum of story points at

  1. start of sprint
  2. end of sprint
  3. issues added to a sprint
    and
  4. issues removed from a sprint.

Originally tried to do numbers 2, 3, and 4 in one automation, but was only getting data for the first "event" (#2). That automation has since been broken into 4 separate automations, each focusing on one of the four events listed above. Since the first two are triggered when a sprint starts / completes, the jql (details below) doesn't include an issueFunction and return results as expected. Originally tried triggering numbers 3 and 4 on sprint completed event, but the results were empty. I have cloned the automation and triggered it by commenting on a specific issue for easier debugging.

sprintEvent:

  1. Sprint Started
  2. Sprint Closed
  3. Issue Added
  4. Issue Removed
    Jira Rule - Set Variable.png

boardName: Name of the sprint board used in the project

sprintId: 

  1. This automation is triggered when a sprint is started. and set to {{sprint.id}}. This technically not needed; included so automations are consistent.
  2. This automation is triggered when a sprint is started. and set to {{sprint.id}}. This technically not needed; included so automations are consistent.
  3. Manually updated before manually triggering the automation that identifies the number of issues and sum of story points added to that sprint
  4. Manually updated before manually triggering the automation that identifies the number of issues and sum of story points removed from that sprint

jql

  1. Sprint = {{sprintId}} AND issuetype not in subTaskIssueTypes()
  2. Sprint = {{sprintId}} AND issuetype not in subTaskIssueTypes() AND (statusCategory = Done or Status = "Ready for Release")
  3. issueFunction in addedAfterSprintStart("{{boardName}}", {{sprintId}}) AND (labels is EMPTY or labels not in(Placeholder))
  4. issueFunction in removedAfterSprintStart("{{boardName}}", {{sprintId}}) AND (labels is EMPTY or labels not in(Placeholder))

Suggest an answer

Log in or Sign up to answer