Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Add number to date field using SIL Script Edited


I have a date field say customfield_A and a number field customfield_B.

I want to add customfield_A + customfield_field. Days should be added with the date.

Here is the script i use which does not work.

string format = "yyyy-MM-dd";

date resolved = customfield_A + customfield_B;

if(formatDate(resolved, format) == formatDate(currentDate()+"2d", format))

The highlighted line is causing the issue.

Below is the error i get,

"Exception while executing SIL program >>Autotransition.sil<<: [SIL Error on line: 3, column: 37] Unsupported PLUS operation between [DATE] "

Please let me know how can i achieve this through SIL script.



2 answers

0 votes
Danyal Iqbal Community Leader Feb 14, 2018

You can't add numbers to dates :)See Type casting

0 votes

I was able to do it like this

string format = "yyyy-MM-dd"

interval interv = #{number field Name} * 24*60*60*1000; // number to days
date resolv = #{date field Name} + interv; // add interval
date curDate = currentDate()+"2d"; // add 2 days to the current date
if(formatDate(resolv, format) == formatDate(curtDate+"2d", format))

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,881 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you