Do a calculation

Mohamed Eid
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!
February 4, 2025

Trying to do a sum of two values I have

The first one is start date and the second is remaining days

Both are written in Jira description custom field

However seems that they are string and cannot be added together

I ve tried to convert them to numbers but could not

So what i am looking for is to do the addition of the date and the number of days to get the expiry date and add it to the summary

 

2 answers

0 votes
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hi @Mohamed Eid 

Could you elaborate further on the problem you wish to solve? You have both the start date and the remaining days in the issue's description field, and you want to perform a calculation to determine the expiry date; is that correct?

The description field is a text field and can contain a lot of free-format text, which makes implementing such a scenario unreasonable. I would strongly suggest using a separate field for each and conducting the calculation accordingly.

If I am missing anything, could you provide some examples?

Mohamed Eid
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!
February 4, 2025

So in Jira task description there is the two values as follows :

-----Q-------

Jira description :

 

The server xxxxx certificate is expiring in 44.9999 days,

 

This started at 2025-01-18 01:00:10 CET, – or 0h 0m ago.

----Unq-----

 

So what I want is to add 2025-01-18 01 and 44.9999 to give me the certificate expiration date which should be 2025-03-03 

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

I don't believe this is the most effective way to achieve this. I mean, you need to use a regular expression to parse the entire description field, select the relevant parts, and perform the calculations. This is not particularly difficult, but it is quite error-prone. There may be other dates and time indicators; how will they be handled? Additionally, there may be weeks, hours, etc.

As I mentioned earlier, it is best to use separate fields and the appropriate field types (date, number).

0 votes
Vishal Biyani
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.
February 4, 2025

@Mohamed Eid 

Look at this link that gives you details about how to add date and number 

Examples of using smart values with dates | Cloud automation Cloud | Atlassian Support

Try this out and see if it works for you

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events