Forums

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

Can the value of one custom field be extract from the value of another custom field

Lusine
Contributor
March 12, 2024

Hi everyone,

My problem is the following:

I want to extract the value of <Field 2> from the value of <Field 1> and put the difference in the <Field 3>․ And I need the Field 1 to be fixed amount for the year, and each time I open the issue I need this field to be the result of the Field 3 of previous issue. I will need to update the number every year.

For example

Field 1 - 10000

Field 2 - 4000

Field 3 - 6000

How can I have this. That will help a lot.

2 answers

1 accepted

4 votes
Answer accepted
Marc - Devoteam
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 12, 2024

Hi @Lusine 

This can be done with an automation rule depending all the fields are of the type number.

On the edit action set Field 3 as: {{#=}}{{issue.field1}} - {{{issue.field2}}{{/}}

I don't know what you exactly mean with the 2nd part of your post, can you elaborate?

Lusine
Contributor
March 12, 2024

Hi @Marc - Devoteam 

Thanks a lot for the first part!
The purpose is to fix a yearly budget for the issue and to extract the amount of field2 every time the issue is created and when the number is 0 to show an error when I try to create a new issue.

Is it possible to do this?

Marc - Devoteam
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 12, 2024

Hi @Lusine 

That part is tricky and might no be possible.

As I understand you want to create a new issue and then Field 1 needs to have the value of Field 3, but the system doesn't know what the previous issue was.

You could tackle this with another automation with a manual trigger and clone the previous issue and copy the value of field3 of the trigger issue to field1 on the new issue.

You can have a condition in this automation to check if the value on the trigger issue in field3 is not 0 and then stop the automation.

This does mean you should not create issues in this project via the create button.

Lusine
Contributor
March 12, 2024

Thanks a lot @Marc - Devoteam , I'll try to do it that way.

Like Marc - Devoteam likes this
0 votes
Jack Brickey
Community Champion
March 12, 2024

Hi @Lusine , you can use Automation for this. Are you comfortable with writing Automation rules? There are a number of post discussing calculating the difference between two fields (dates is the most talked about).

Basically you can use the "minus" automation function here. For example...

{{issue.field 1.minus(issue.field 2.abs)}}

you would add an Edit action and choose Field 3 to edit and set the value to the above smartvalue expression. Note the "abs" would return the Absolute value but if you wish to retain the sign then leave that off. I am working from memory (have not tested) so let me know if it does not work.

Lusine
Contributor
March 12, 2024

Hi @Jack Brickey , 

Thanks a lot for your help.

Maybe you know a way to do this too:

The purpose is to fix a yearly budget for the issue and to extract the amount of field2 every time the issue is created and when the number is 0 to show an error when I try to create a new issue.

Suggest an answer

Log in or Sign up to answer