Forums

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

Comparison within a field followed by a comparison to another field

Sven Meier
Contributor
August 29, 2025

Dear Community,

Could someone please help me with the automation I try to build?

There are several steps I need help with.

 

1. Comparison of values within a field. We have a customized field called "ICE Task". We can put in multiple ICE Tasks within that field. Now, I would like to compare the values of that field to be specific {{triggerIssue.customfield_10104.RELEASE}}. Would that be even possible? (The information you get from that look like: LG57_24.09.00)

2. Comparison between different fields: If 1. is possible I would like to compare the lowest release with another field called "Avaloq Release", to be specific again {{issue.customfield_10103.Name}}. The information you get from that looks like: 24.09.00

3. If 1. and 2. is possible I would like to have different actions depending of the result of the comparison.

3.1. If 2. is true then create an approval and transition work item status

3.2. If 2. is false then send an email and do not transition work item status.

 

I was able to make a comparison between "ICE Task" and "Avaloq Release". That looks like this: it is a smart value condition

- First Value: {{triggerIssue.customfield_10104.RELEASE}} (= ICE Task)

- Condition: contains

- Second Value: {{issue.customfield_10103.Name}} (= Avaloq Release)

Any help or tip is encouraged and greatly appreciated.

Sven

1 answer

0 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.
September 2, 2025

Hi @Sven Meier 

What you describe is possible using text functions to extract the date from the field and then converting that with toDate, and then performing the comparisons.  And if there are a list of date values, those could be examined using the list min function to find the smallest one.

Here are some documentation references to you help you do this:

 

If you encounter further challenges, please provide more context by posting:

  • what version of Jira are you using: Cloud, Server, or Data Center
  • an image of your complete rule
  • an image of the audit log details showing the rule execution
  • explain what is not working as expected, and why you believe that to be the case

 

Kind regards,
Bill

Sven Meier
Contributor
September 12, 2025

Hi @Bill Sheboy 

 

First of all many thanks for your input. Then, at first it looked very promising. Unfortunately, I am still unable to find a working solution.

Secondly, unfortunately it is prohibited for some reason in our company to upload pictures. Apologies for that inconvenience.

I tried many things from the websites you kindly provided.

I tried with max and min and first and substring. Unfortunately, those I needed most to work for example min seems to not work on that customfield.

 

I'll explain:

 

We have those two custom fields:

Avaloq Release and Ice Task

- Avaloq release is a single value field, meaning just one Avaloq Release can be added

- Ice Task is a multi value field, meaning one or more Ice Tasks can be added

 

when you give them out they look like this:

avaloq release:

- Input 1: {{issue.customfield_10103.Name}}

- Output 1: 25.09.00

ICE Task:

- Input: {{triggerIssue.customfield_10104.RELEASE}}

- Output: LG57_24.09.00, LG57_25.03.00, LG57_24.06.00


So far I was able to compare ice task with avaloq release with a smart value condition that compares the two values.

 

{{issue.customfield_10104.Release}} does not contain {{issue.customfield_10103.Name}} 


but in order for that to work the way I need it to, I would first need to find out which is the lowest value in ice task (in the example I used above the lwoest out of the three would be 24.06.00). Only after the lowest value was determined a comparison should be made between the avaloq release and Ice Task. Unfortunately, min-function does not work with the ice task custom field (I used {{triggerIssue.customfield_10104.RELEASE.min}} for trying to get the minimum value, please correct me if this is wrong). So, what I would need is some sort of function that either sorts them in ascending or descending order and then work with first or last respectively or a minimum function that works with that custom field or another solution I am unable to come up with :)

Kind Regards,

Sven

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.
September 12, 2025

Thanks for the additional information, @Sven Meier 

As you cannot post images, you could also list your rule steps in bulleted text, adding any smart values used, and copy-and-paste the audit log results.  That context will provide some context for what you are trying.

Back to your question...

 

You are correct the min function works on number and date / time values, and not plain text.  And, because one of the fields is multiple-selection, JQL cannot be used to solve this because it would sort on groups of selections, not the individual selections.

 

Fortunately, the part you want to compare only contains digits and periods, and so that could be converted into a number using text functions, and then the min function may be used.  This approach will work for Jira Cloud, but not for Server / Data Center versions, as they do not have the asNumber function.

For example, assuming your ICE Task field is multiple-selection, option type:

{{triggerIssue.customfield_10104.value.substringAfter("_").replace(".", "").asNumber.min}}

How that works is:

  • using inline iteration over the field values
  • extract the text after the underscore character _ using substringAfter
  • replace any periods with an empty string
  • convert the result to a number with asNumber
  • and now that we have a list of numbers, the min function will work

If your field is another type, please adjust the expression accordingly.

Similarly for the avaloq release field, you may remove the periods, convert to a number, and then compare to the above result for equality.

 

As noted above, this works for Jira Cloud.  The workaround for Server or Data Center versions would use a math expression to find the minimum value:

{{#=}} MIN ( {{triggerIssue.customfield_10104.value.substringAfter("_").replace(".", "").join(", ")}} ) {{/}}

 

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.
September 20, 2025

Hi @Sven Meier 

Just following up to check if this answered your question.  If so, please consider marking this one as "answered".  That will help others with a similar need find solutions faster.  If not, please let the community know what help you need with the rule changes.

Thanks!

Sven Meier
Contributor
September 22, 2025

Hi @Bill Sheboy 

Unfortunately it did not quite workout yet. I am currently fighting with IT and compliance that they let me upload pictures.

FYI:

  • We are working with Jira Cloud
  • Ice Task:
    • One or more values can be entered into the "Ice Task" / customfield_10104 - field.
    • Ice Task contains many information and one of it is "RELEASE"
    • Format of RELEASE is as shown below: LG57_24.09.00
  • Avaloq Release:
    • Avaloq Release / customfield_10103 allows only one input.
    • Avaloq Release contains many information and one of it is "NAME"
    • Format of Name is 25.09.00
  • desired goal:
    • is to somehow get the lowest value from the ICE Task - in the example below (case 12) it would be LG57_24.06.00 as this would allow me to compare this value with the avaloq release for example with a {{smart values}} condition:
      • {{issue.customfield_10104.Release}}
      • does not contain
      • {{issue.customfield_10103.Name}}

I tried many versions of what you put above:

1

{{triggerIssue.customfield_10104.RELEASE.value.replace(".", "").asNumber.min}}

Result: nothing
2
{{triggerIssue.customfield_10104.RELEASE.value.substringAfter("_")}}

Result: nothing
3
{{triggerIssue.customfield_10104.RELEASE.replace(".", "").asNumber.min}}

Result: nothing
4
{{triggerIssue.customfield_10104.RELEASE.substringAfter("_")}}

Result: nothing
5
{{triggerIssue.customfield_10104.RELEASE.substringAfter("_")}}

Result: nothing
6
{{triggerIssue.customfield_10104.RELEASE.join(" - ").substringAfter("_").replace(".", "")}}

Result: 240900 - LG57_250300 - LG57_240600

7
{{triggerIssue.customfield_10104.RELEASE.join(" - ").replace(".", "").substringAfter("_")}}

Result: 240900 - LG57_250300 - LG57_240600

8
{{triggerIssue.customfield_10104.RELEASE.substringAfter("_").replace(".", "")}}

Result: nothing
9
{{triggerIssue.customfield_10104.RELEASE.replace(".", "").substringAfter("_")}}

Result: nothing

10

{{triggerIssue.customfield_10104.value.substringAfter("_").replace(".", "").asNumber.min}}

Result: nothing

11

{{triggerIssue.customfield_10104.RELEASE.substringAfter("_").replace(".", "").asNumber.min}}

Result: nothing

12

{{triggerIssue.customfield_10104.RELEASE}}

Result: LG57_24.09.00, LG57_25.03.00, LG57_24.06.00

 

Best,

Sven

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.
September 22, 2025

Thanks for that information, @Sven Meier 

Let's confirm something: what is the field type for customfield_10104?  I ask this question as the built-in fields do not have an attribute named RELEASE, and thus I suspect this is an asset object.  Is that the case?

 

Sven Meier
Contributor
September 25, 2025

 

@Bill Sheboy I hope you are able to see the picture now. So, yes from my understanding it is an asset object.

2025-09-25_10-09-00.PNG

Like Bill Sheboy likes this
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.
September 25, 2025

Thanks, @Sven Meier as this may indicate there is a timing and / or typing problem.  My understanding is some data in rules such as Assets are looked up just-in-time rather than instantly and always available.

We may test this using a Created Variable.  That will force full evaluation / loading of the information before the rule continues, converting the values to text.

  • action: create variable
    • name: varRelease
    • smart value: {{triggerIssue.customfield_10104.RELEASE}}
  • ...now, try experimenting by substituting {{varRelease}} in those expressions to parse out the values

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events