Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Max function in Jira smart values

Hi Team,

How to find out min or max value in a smart value generated by jira automation.

In an automation i started figuring out some numbers from user stories under epics, now i want to list out which is max & min in that list.

here is the sample pic of audit log

image.png

I need to find which is maximum value in (25, 11, 15,-2)

 

Thanks in Advance.

 

Raju

2 answers

Hi @Seetham Raju 

If the numbers are in a list, you can use the list.min and list.max functions as described here: https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/

For example, if you use the Lookup issues action, you could do something like {{lookupIssues.Story Points.min}} and {{lookupIssues.Story Points.max}}.

Hi @Gareth Cantrell 

First thing is, those values are not in a list (they are individual values generated from stories under an epic) and the functions list.max or list.min are not working.

In this view i am having 2 questions.

Question 1: How to create a list of those values??

Question 2: Is there any custom field which stores multiple numerical values.

 

Thanks in advance,

Raju

@Seetham Raju how are you defining your rule? If you can share a screenshot of what your rule looks like, rather than the audit log, we can make a suggestion that may help.

@Gareth Cantrell ,

Let me clearly explain my concern/problem.

I want to get the latest sprint name that has longest timeline or close at last.

Lets say, EPIC-1 stories are distributed in 3 sprints with different end date.

Epic 1:

-sprint 1 - Timeline: 10-28-2019 to 11-15-2019

--- Story1

--- Story2

-Sprint 2 - TImeline:  11-04-2019 to 11-12-2019

--- Story1

--- Story2

-Sprint 3 - TImeline:  11-04-2019 to 11-29-2019

--- Story1

--- Story2

The script should return "Sprint 3" name. I able to find the sprint name and date value for each sprint but i not sure how to compare date for each sprint and get the latest sprint date.

Thanks in advance

Hi @Seetham Raju 

If the LookupIssues action supported all fields, which it does not yet do, this would be easy. Here is a suggestion to add that capability: https://jira.atlassian.com/browse/JRACLOUD-75018

Until then you may try a couple of work-arounds using automation rules.

  • Simple solution: Add custom fields to the parent epic (maxMyNumber and minMyNumber), and every time a child story is updated such that it has a new max/min, trigger a rule to update the parent's custom fields.  They should then be up to date when you need them.
  • Very complex solution: Send a web request from the rule to call the REST API for a JQL search of issues, ordering the results by your number field.  Parse the resulting JSON to get your custom field values, putting them into a created variable as a CSV list.  Use the text and list functions to get the min and max from the list.  (Honestly, I only did this one to see if it was possible.  I do not recommend it.)

Best regards,

Bill

Hi @Bill Sheboy 

Let me clearly explain my concern/problem.

I want to get the latest sprint name that has longest timeline or close at last.

Lets say, EPIC-1 stories are distributed in 3 sprints with different end date.

Epic 1:

-sprint 1 - Timeline: 10-28-2019 to 11-15-2019

--- Story1

--- Story2

-Sprint 2 - TImeline:  11-04-2019 to 11-12-2019

--- Story1

--- Story2

-Sprint 3 - TImeline:  11-04-2019 to 11-29-2019

--- Story1

--- Story2

The script should return "Sprint 3" name. I able to find the sprint name and date value for each sprint but i not sure how to compare date for each sprint and get the latest sprint date.

Thanks in advance

Hi @Seetham Raju 

Thanks for clarifying your question. 

For looking at historical data (past sprints), I have always done comparisons like this by exporting to a spreadsheet and parsing the results.  Jira adds new sprints to an issue when items are carried over, and I do not believe the built-in automation rule functions can easily determine the maximum/latest sprint in the field.

For future sprints which have not started yet, I suggest using the custom field method, such as maxSprintStartDate in the epic, and use a rule triggered on Sprint Started to walk the issues and update the parent epic.  Jira date (and date/time) values are just numbers and so you can compare to find the latest one for updates... Or, always assume your sprints are non-overlapping and the "last update" is always used.

Like Seetham Raju likes this

Hi @Bill Sheboy 

 

I am looking for a automation rule

I understand your request, and the only way I see to do this currently is the method I noted with the web request call to the REST API, and using extra custom fields.

For one individual issue the maximum Sprint Date value is {{issue.sprint.endDate.max}} but getting at that value spanning a list of issues is the challenge.  If you use one rule to save the max in a custom field for each issue and then a second rule with the web request method, you can get to one maximum value spanning the set.

 

It would be easier to just update the parent epic when a sprint starts with a date later than some field in the epic in a single rule.

Like Seetham Raju likes this

Thanks @Bill Sheboy for the information, can you please elaborate more about the second rule web request method.

I am not having any idea about this 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you