Forums

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

Auto populate one field based on values in anothers Custom Fields

Maycon de Souza Leal
Contributor
January 3, 2024

Hello,

I have a custom field "Follow-up" which is a Text field.

I want to populate this field according to other custom fields.

I would like to know if it is possible to do it through automation or post-function.

 

The other fields are:

  • Management (It will always be the "GIT" value)
  • Requester 
  • Costing
  • Issue key

 

The idea is that this field is filled with the pattern below:

<Management>-<Requester>-<Costing>-<Issue key>

 

The "Requester" custom field is multiple choice. And if I choose one of the options in the field, a number will be inserted in the "Follow-up" field:

  • Requester ONE = 35611

  • Requester TWO = 35631

  • Requester THREE = 35621

 

The "Costing" custom field is a single choice. And if i choose one of the options in the field, a letter will be inserted in the "Follow-up" field:

  • Option 1 = P
  • Option 2 = R

 

The "Issue key" will be from the issue itself.

 

Example of how the "Follow-up" field would be filled out:

  • GIT-35611-P-EC-318

  • GIT-35631-R-EC-120

 

The field would be populated as soon as the issue is created.

I will use this case and a single issue type.

 

Can anyone help me?

Thanks.

2 answers

1 accepted

1 vote
Answer accepted
Maycon de Souza Leal
Contributor
January 9, 2024

For anyone who has a case similar to mine, below I will leave a screenshot of how my automation turned out.

print.jpg

0 votes
Evgenii
Community Champion
January 3, 2024

Hi, @Maycon de Souza Leal 

Yes, it's possible.

Just use construction, like

{{issue.customfield_11111}} - {{issue.customfield_11112}} - {{issue.customfield_11113}} - {{issue.key}}

It's very approximate solution. For different field types way of getting their values can differ. You can read about it here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

 

UPD.

If you have values, that are dependent from chosen variant (in Requester), you can add variable and chain of conditions, depending from which variable can be changed.

List of smart values will look like:

GIT - {{reqVariable}} - {{issue.customfield_11111}} - {{issue.key}}
Maycon de Souza Leal
Contributor
January 3, 2024

Hi, @Evgenii 

Thanks for answering!

I understood.

But my biggest question is how to set up the automation.

Another doubt, as mentioned i have other custom fields whose values ​​are one in their options, but I want it to write another value.

Example of the "Requester" field I mentioned. Their options are:
Requester ONE
Requester TWO
Requester THREE

But I want it to write:
35611
35631
35621

This in the "Follow-up" field...

I don't know how I would do this in automation.

Evgenii
Community Champion
January 3, 2024

Got it. Use variables. Look at my examples, they can give an idea, how it can be implemented.  You need to make variable, then assign value to it, depending on selection, made in Requester field.

Screenshot_6.pngScreenshot_7.pngScreenshot_8.png

Like Susan Waldrip likes this
Maycon de Souza Leal
Contributor
January 3, 2024

Evgeniy,

Sorry, but I couldn't understand the example you demonstrated :(

In the "Requester" field I mentioned, I have multiple choice options with text.
And in this case, I want the option chosen in the field to become a number.

I apologize if I am unable to clearly explain my doubts.

Like Susan Waldrip likes this
Evgenii
Community Champion
January 3, 2024

Hi @Maycon de Souza Leal 

You're working with a field that contains text values, each correlating to a specific numeric value. However, Jira doesn't automatically recognize this relationship. Our goal is to instruct Jira on how to associate each text value in the field with its corresponding numeric value, as demonstrated in my example.

Here's what I did in my example:

Creation of a Variable: I introduced a variable named {{requester}}.

Setting Up Conditions: I then constructed a series of conditions. Within these conditions, the {{requester}} variable is assigned different numeric values based on the selected text value from the field. In your case, substitute "Issue Type" in my example with your "Requester" field. Depending on the option chosen, set the {{requester}} variable to 35611, 35621, or 35631.

Utilizing the Variable: Now that you have the {{requester}} variable containing the desired numeric value, you can insert it into a text field. Combine it with other smart values you wish to use, like this format:

GIT-{{requester}}-{{issue.customfield_11111}}-{{issue.key}}.

This method effectively maps the text selections to their respective numeric values, allowing Jira to process them as needed.

Like Susan Waldrip likes this
Maycon de Souza Leal
Contributor
January 3, 2024

Evgeniy,

I understand perfectly now.

However, I can't find the custom field I need in the 'Issue fields condition' list.

I usually find other fields, except what I need.

The custom field i trying to use is the 'Select List (cascading)' type.

Do you know what it could be?

Like Susan Waldrip likes this
Evgenii
Community Champion
January 3, 2024

It's a good question. 

In order to use cascading select list in condition you need to use JQL query condition.

Here is example, how it can look like:

Screenshot_9.png

Like Susan Waldrip likes this
Maycon de Souza Leal
Contributor
January 9, 2024

Hi @Evgenii 

Unfortunately I was unable to create using the "Create Variable" component that you mentioned. But I managed to create it another way.

I only used the "If" and "Else if" components.

Oh, and thanks for the tip with custom field cascade, it was very useful.

Like # people like this
Evgenii
Community Champion
January 9, 2024

Great. Glad, that it helped

Like Susan Waldrip likes this

Suggest an answer

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

Atlassian Community Events