Insert custom field based on value of another custom field.

melissa_kaiser July 8, 2020

Hello,

Hoping someone can help me. 

I'm trying to create an automated rule that will allow me to insert a custom field into a ticket based on the value of another custom field that has already been added to the ticket.

More specifically, if I create a Task and during creation I select "Research" from a Taxonomy single-select list, then I'd like a Research custom field to be added to the task ticket. 

I don't believe there is an "out of the plugin" solution for this, but I'm not a developer and there may be one that I'm not aware of.

Any help would be greatly appreciated.

Thanks,

Melissa

5 answers

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2020

Hi Melissa - Welcome to the Atlassian Community!

You should be able to do this easily with Automation For Jira. Are you using Jira Cloud or Server? 

Here's some more information for Jira Cloud:

There are two types of automation:

  • Global: In the Free version, you get 100 executions per product, per month
  • Project: In all versions, you get unlimited executions per month

Automation Basics: https://www.atlassian.com/software/jira/guides/expand-jira/automation

You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, go to Jira Settings > System > Automation Rules (left-hand menu).

For more on using Automation For Jira see these help pages.

melissa_kaiser July 9, 2020

We already have Automation but there is no option I insert a custom field base on the value of another. 

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2020

Do you have a rule created that you could post here? 

Basically you want to create is a Field Value Changed trigger. 

Then do an Edit issue action. 

There you should be able to set the field value. 

melissa_kaiser July 10, 2020

Yep, that's the rule I created, but there is no action to insert the custom field into the ticket. The field value for the custom field can't be set until the ticket has progressed through the workflow.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2020

So you want to update the field on a Transition - correct? 

And you want to set the value of a field based on the existing value of another field - correct? 

Can you share the rule you have created so far?

melissa_kaiser July 10, 2020

I found the answer elsewhere. Thank you!!

Like John Funk likes this
Wyatt July 20, 2020

what was the answer?

melissa_kaiser July 20, 2020

I started with the trigger (if field = value) then new condition (jql) and then the action (Set Property Entity). It worked like a charm. 😀

Like John Funk likes this
Meital Adir March 10, 2021

Hi @melissa_kaiser @John Funk can you please share more details?

I'm looking for a way to show custom field & make it mandatory based on value selected in other custom field. 

not sure how to use "set property Entity", if that is the solution here.

Thanks

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2021

Hi @Meital Adir  - First, it is always better to create a new question in the Community so everyone will see it and can respond to it. Putting it here will only be seen by the people in this thread. 

Second, you are not going to be able to this out of the box with Jira - you will need an add-on like JWME or ScriptRunner so you can do conditional validation. 

1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2020

Hi Iman,

First, it is always best to create a new Question in the Community instead of adding on to previous questions. That way more people will see the question and not just those that have responded to this question. 

Second, instead of doing that through the advance settings, why not just create a Condition and use the Advanced Compare Condition. There you can compare the two fields. Then add a New Action component to do what you need. 

CHILUMKURU June 15, 2022

Hi John, 

My requirement is:

If Issue type = Bug and a custom field Test type = Automatic then activate another custom field Root cause with all List of values in New issue creation.

can you confirm if the automation requirement works in New issue creation screen?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 15, 2022

Hi Praveen,

Automation cannot "activate" fields. What exactly are you trying to do? 

CHILUMKURU June 15, 2022

Hi John,

Thanks for your reply.

I am trying to do automation for below requirement.

When user create a new bug in New issue creation screen, Automation need to activate a new custom field Rootcause (drop down list), when user selected a specific value (e.g. Automatic) in another custom field Test Type (drop down list). I hope this is clear what I am trying.

Have a good day.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 15, 2022

What do you mean by "activate"? 

CHILUMKURU June 15, 2022

I mean enable a custom field 'Rootcause' when user selected value Automatic in another custom field 'Test Type' while creating a new bug. Please refer sceenshot for quick reference.New-Issue-Creation.jpg

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2022

You can't enable fields - meaning show them or hide them based on values of other fields, if that's what you mean. the field is either on the screen or it isn't. 

CHILUMKURU June 21, 2022

Hi John,

Thanks for response.

Yes, I meant same. I want to enable Rootcause custom field (highlighted in green) when user select Automatic value from Test Type Custom field (highlighted in yellow) in New issue creation screen.

If not possible, is any other alternative solution to achieve this?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2022

ScriptRunner has a product coming out soon as an add-on for Jira Cloud called Behaviours. It might can do the trick. I think it is in Beta right now. 

CHILUMKURU June 21, 2022

Hi John, Thanks once again for your swift response.

I am not sure Script Runner is a free version, but it requires a long process to get approvals from our internal compliance team even if it is free version (just in case).

 

Thanks

Praveen

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2022

Yes, that is true - but it is the only way you will be able to accomplish what you want to do. There is no other option. 

CHILUMKURU July 3, 2022

Thanks John for your thoughts. I hope you are doing good.

After discussion with requestor, so I changed  the problem statement as below,

For a bug type when Jira status is changed (e.g. from DEV completion to INT in progress) the custom field "Rootcause" should be mandatory if the another custom field "Testtype" value is automatic. I did some exploration by Trigger, condition and post condition in workflow properties, but I am facing a problem that Rootcause field is still showing as mandatory field, even Testtype field vaue is reset.

Not sure if I am missing anything or need to do some more analysis.

Please share your thoughts.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 4, 2022

Once again, you can not make a field mandatory or not mandatory based on the value of another field in Jira Cloud. It's just not possible. 

0 votes
Tzirel Shaffren June 26, 2023

Any recent updates on this? I figure that it's been about a year and maybe something is available now that wasn't then. I am trying to do the following:

  • On the Create Issue screen there is a custom field called A that has a dropdown of choices 1, 2, 3
  • If 2 is selected, I would like another custom field to appear on the Create Issue screen. Otherwise, it remains hidden 

Can this be done?

0 votes
Iman October 27, 2020

I'm trying to create an automation rule in Cloud;

On creation;

If Creator = Reporter

Action: Link all tickets in the project

 

I've tried;

resolution = Unresolved AND issuefunction in expression("project = TSD", "Creator = reporter")

 

But I get the error:

Field 'issuefunction' does not exist or you do not have permission to view it.

 

I am an admin for the project, any suggestions?

0 votes
Yana Nikolayeva August 3, 2020

Hi Melissa, I am actually trying to do something similare as I need to populate Filed 2 (with 3 values in it) based on selection of field 1. Example:

Filed one have 3 values:  A, B and C

If Field 1 = A then Filed B should be (1,2,3)  

If Field 1 = B then Filed B should be (4,5,6)  

If Field 1 = C then Filed B should be (7,8,9)  

I am not expert in jql and not sure how to create a rule that will do what is needed.

Can you or someone help? 

JIRA Study August 7, 2020

 

I'm also trying to do the same. I'm using jira software cloud. Can someone help me with the solution

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events