How to copy 8 percent of custom field value to another custom field

VENKATESHWARARAO November 16, 2020

Hi,

We have a requirement to copy the 8 percent of custom field value to another custom field in a workflow transition. If the value is less than 1, then round off to 1. If the value is greater than 1, take the same value. We have JSU add-on, JWT add-on and Script Runner add-on. Could you please help me .

 

Thanks in advance.

1 answer

1 vote
Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 16, 2020

Hi @VENKATESHWARARAO ,

if I get your use case right, you should be able to use an expression like this with JWT:

{nnnnn} * 0.08 < 1 ? 1 : {nnnnn} * 0.08

nnnnn has to be replaced with the value of your source custom field.

The behavior is: return 1 if multiplying this field with 0.08 (the 8 percent) is lower than 1 and return the result otherwise. 

Please let me know if I understood you correctly and this solves your request.

Cheers
Thorsten

P.S. You should obviously go for an update issue fields post function, selecting your target field and then using the numeric parsing mode.

VENKATESHWARARAO November 23, 2020

Hi @Thorsten Letschert _Decadis AG_ ,

 

Thank you for the response. When I am trying to implement above expression, it's not copy the value. Just it copy the entire expression new custom field. Could you please help is there anything I want to do.

 

Thanks in advance.

Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 24, 2020

Hi @VENKATESHWARARAO ,

please make sure, the 'Parsing mode' is set correctly. However, if you're saying that the whole expression is being copied, I assume that you have a text field here.

For a number field, choose Math/Time expression - for a text field, choose Parsed text (advanced mode).

community_parsing-modes.png

Cheers
Thorsten

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.8.1
TAGS
AUG Leaders

Atlassian Community Events