Forums

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

Populate field based on a combination of other fields

Adam Cormack
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2023

Desired Use Case:

  • Feature/Requirement is created in Aha! including "Component" and "Sub-Component" fields
  • Sent across to JIRA using the native integration, creating a JIRA Epic and associated stories
  • There is an additional field on the JIRA Story, called "Risk Assessment", this field should be populated by a value based on the values of "Component" and "Sub-Component"

The values in "Component" and "Sub-Component" are Text Based

Risk Assessment should be a Boolean value "Yes" or "No"

Example:

If Component = Value A, Value B or Value C

and

Sub-Component = Value 1, Value 2 or Value 3

then

Risk Assessment = Yes

else

Risk Assessment = No

 

What would be the best way to achieve this use case? 

2 answers

0 votes
Ash Yadav
Community Champion
March 11, 2023

Hi @Adam Cormack 

In this instance I would recommend taking a look at setting automation rules as @Bill Sheboy mentioned as what you're describing is achievable with a Field Value Changed Trigger and Edit Issue Action (To update the Risk Assessment field).

You did mention sub-components, are these custom fields you have? (Both for component and sub-component) 

Because as far as I'm aware sub-components aren't natively available in Jira Cloud. 

https://jira.atlassian.com/browse/JRACLOUD-846

Unless you use a 3rd party plugin such as: https://marketplace.atlassian.com/apps/1211548/subcomponents-for-jira?tab=overview&hosting=datacenter

Alternatively: 

  1. Create a custom field in JIRA called "Risk Assessment" with a data type of "Boolean".
  2. Configure the Aha! JIRA integration to map the "Component" and "Sub-Component" fields to their corresponding fields in JIRA when creating Epics and Stories.
  3. Create a JIRA workflow post-function that sets the value of the "Risk Assessment" field based on the values of the "Component" and "Sub-Component" fields.
  • The post-function could be implemented using a scripting language supported by JIRA (Groovy or JS for example).
  • The script would need to retrieve the values of the "Component" and "Sub-Component" fields from the JIRA issue and compare them to the specified values in the use case.
  • Based on the comparison, the script would set the value of the "Risk Assessment" field to either "Yes" or "No".

I would personally use automation as it pretty much achieves the same result without having to write any custom code. 

 

Kind Regards,

Ash

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.
March 11, 2023

Hi @Adam Cormack -- Welcome to the Atlassian Community!

I do not know if there is a "best" way to do this, although I can think of a couple of approaches:

  • if you have one of the marketplace addons for scripting, you could make a calculated field
  • you could use the built-in feature of automation rules to set the field

Kind regards,
Bill

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