Forums

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

Jira Automation: How to add/subtract an integer to/from a variable that's already having a number

Rishi Ravindra
Contributor
May 30, 2023

Hi,

 

I have a custom field "Event Date" that has 2023-05-02T08:00:00.0+0000.

 

From the above, I created a variable YY that has 23.

 

Now, I need to add +1 or subtract -1 from YY (i.e. 23+1 or 23-1) and store it in another variable, how to achieve that? i tried creating another variable FY and tried setting it to {{FYP.plus(1)}} but it returned blank.

1 answer

1 accepted

2 votes
Answer accepted
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.
May 31, 2023

Hi @Rishi Ravindra 

Created variables are text and not numbers.  Please try converting the value before the operation: 

{{FYP.asNumber.plus(1)}}

Kind regards,
Bill

Rishi Ravindra
Contributor
June 1, 2023

Worked like a charm, thanks Bill.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer