Forums

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

Using Automations to ADD a Label derived from multiple Custom Field values

Doug Winenger
Contributor
May 17, 2023

I am attempting to use automation to ADD a dynamic Label derived from two custom fields.

  • I want to apply a label that is a concatenation of a string and two custom fields' values like:
    • "string-{{cf1_Value}}-{{cf2_Value}}"
  • the idea is that cf1 and cf2 will change over the life of the issue
    • cf1 is a string (from a dropdown) and cf2 is a number
    • when certain conditions are met, I want to apply a label to "capture" that the issue achieved that particular status

 

The automation currently is attempting to do the folllowing:

  1. When: Issue updated
  2. IF:matches
    1. cf1_Value = "someString"
      1. Then: transition the issue to paused
      2. And: Edit issue fields
        1. cf2_Value = {{#increment}}{{issue.cf2_Value}}{{/}}
        2. Labels =
          1. (ADD) "string1", "string2-{{issue.cf1_Value}}-{{issue.cf2_Value}}"*
          2. (REMOVE) [none]

*Note:

  • I can't replicate the exact syntax here
  • "string1" in the label update is a static string/label
  • the second label, "string-{{cf1_Value}}-{{cf2_Value}}", is the dynamically derived label just in case my syntax is not clear.

 

  • I've also attempted to use
    • json/more options via the "Edit issue fields" - for example:

{

     "update": {

          "labels": [{

               "add": "string1"    

                    },

                    {

               "add": "string2-{{issue.cf1_Value}}-{{issue.cf2_Value}}"

                    }]
     },
}


The cf1_Value is the display name of the custom field vs. the ID (cf#####) format.

 

I feel like one of these options should enable this operation but so far, I've not been able to crack the nut.   Anyone have a solution for this challenge?  Thanks!

1 answer

0 votes
Joe Pitt
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 Champions.
July 3, 2018

Not out of the box. You may be able to do it with a listener.

I STRONGLY suggest you treat all updates to JIRA besides adding users as a production system under change control. That will handle item 2 and a bunch more that will come up if you don't manage JIRA like a production system. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events