Forums

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

Is it possible to add a field to itself?

Eric Bailey
Contributor
December 21, 2023 edited

So, in our project, we track Dev Estimates and QA Estimates.

Currently, we have an automated rule to calculate Dev Days based on whether the estimates are hours, days, weeks, months.  We have the same formula to calculate QA Days based on QA Estimates.

However, we track capacity in Dev Days.  We would like to still use Dev Days for this, but add in the QA days to it.  Is it possible to do this?  Basically, set Dev Days = Dev Days + QA Days?  Or do we need a completely separate field to accomplish this?

Currently, trying to set Dev Days to 

{{#=}}{{Issue.customfield_11259.value}} + {{Issue.customfield_11259.value)}{{/}}

Where 11258 us Dev Days and 11259 is QA days.

1 answer

0 votes
Megha Rajanna
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.
December 22, 2023

HI @Eric Bailey 

Assuming that customfield_11258 represents Dev Days and customfield_11259 represents QA Days, your approach to use an automation rule for updating the Dev Days field by adding the QA Days should work.

Here's the expression:{{#=}}{{Issue.customfield_11258.value}} +{{Issue.customfield_11259.value}}{{/}}

check with this once

Navigate to Jira Settings:

Go to Jira Settings > Issues.
Find Automation:

Look for Automation in the left sidebar.
Create a New Rule:

Create a new rule and choose the appropriate trigger, such as "Issue Updated" or "Field Value Changed."
Define the Condition:

Set conditions based on your workflow or criteria. For example, you might want the rule to trigger when the issue transitions to a certain status.
Define the Action:

Add an action to perform the calculation and update the Dev Days field.
Use the expression {{Issue.customfield_11258.value}} + {{Issue.customfield_11259.value}} in the appropriate field update or custom field value action.
Test and Save:

Test the rule with a sample issue to ensure it works as expected.
Save the automation rule.

 

Thank you,

 meghar_empyra

Eric Bailey
Contributor
December 22, 2023

Agree.  It should work, but I get this error

Missing parameter(s) for operator +u: +

the actual formula is: {{#=}}{{Issue.customfield_11229.value}} + {{Issue.customfield_11259.value}}{{/}}

Does it matter that QA Days (custom field 11259) is being calculated in the rule previously?  For instance,

If QA Estimate.child is Days, then QA Days= QA Estimate.

Then Dev Days = Dev Days + QA Days.

My concern is the QA Days doesn't actually get set until the end of the automation, so it is NULL or Empty when it gets to that final calculation.

Eric Bailey
Contributor
December 22, 2023 edited

Through trial, I tried adding the Pipe to the end 

{{#=}}{{Issue.customfield_11229.value}} + {{Issue.customfield_11259.value|4}}{{/}}

Dev Days was then changed from 1 (previous value) to 4.  I would have expected 5.

So, the issue isn't with the formula itself.  It is with the values in those fields maybe?  

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events