Automation

THƠ NGUYỄN VĂN October 3, 2023

I have number series (1,3,5,4) how to get max value in automation, thanks all

4 answers

2 votes
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.
October 4, 2023

Hi @THƠ NGUYỄN VĂN 

Where is your list of values?

For example, if you have a comma-separated list of values in a field, you may convert those into a list and find the maximum using list functions: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/

{{issue.yourFieldName.split(",").max}}

Kind regards,
Bill

2 votes
Peter_DevSamurai
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 4, 2023

To determine the maximum value from a number series in a Jira automation rule, you'll need to make use of smart values and conditional logic.
However, Jira automation doesn't inherently support calculations like finding the max value from a series of numbers. But there are ways to get around it based on specific use cases. Here's a general approach that you could consider:

1. Using Jira Automation: Jira's automation capabilities do not provide direct functionality to process an array of numbers and extract a maximum value. Instead, you'd have to use conditional statements for known potential values. This is a bit clunky and not scalable.

2. Using a Script: If you are using apps like ScriptRunner for Jira, it becomes straightforward. You can create a custom script to get the max value from a series of numbers. For instance, in Groovy (used by ScriptRunner):

groovy def numbers = [1, 3, 5, 4]
return numbers.max()


3. Utilizing External Tools: Depending on your exact requirements, another option might be to process the data externally (e.g., by sending the data to an AWS Lambda function, processing it there, and sending back the result to Jira).

4. Manual Entry: If you're working with a limited set of values (as in your example), and you know these values won't change often, you can set up a rule with conditions to check each number and determine the maximum.

However, this is not efficient for a larger set of numbers. Remember, how you approach this largely depends on your specific requirements, the tools you have at hand, and the flexibility you require in your Jira instance. If you could provide more context on where these numbers are coming from and how they're used in your Jira automation, I could potentially offer a more tailored solution.

THƠ NGUYỄN VĂN October 4, 2023

jira automation has 5 variables, the first 4 variables each have the value 1,2,3,4 and the last variable takes the highest value of 1 of the first 4 variables
You can see the image below

Screenshot-demo.png

1 vote
Mohammed Aamer Khan
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.
October 4, 2023

Hi @THƠ NGUYỄN VĂN

You can use "If/else" condition in your automation and use JQL to filter your requirement and in action item you can select edit issue and add value accordingly.

For Example:
Condition :  if(Finance> "progress and Quality" and Finance > "Reputation and creditability" and Finance > "Resources")
Action Item: Edit Issue --> copy Finance value to Impact Level


THƠ NGUYỄN VĂN October 4, 2023

Okie, I resolved it, thanks so much Brother

Mohammed Aamer Khan
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.
October 4, 2023

@THƠ NGUYỄN VĂN

Great Please accept answer as it resolves your query.

Like THƠ NGUYỄN VĂN likes this
0 votes
THƠ NGUYỄN VĂN October 16, 2023

I resolution it as below @@
{{#=}}MAX(1,2,3,4){{/}} // log is: 4

Hope it will help anyone who needs it

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events