I am trying to set a value of "Due Date" field to some value (current date or current date + 5 days) using JMWE post function, but no results. Can anyone advise something on this matter?
It is indeed possible, but you need to look at the Java documentation for the Date class (your snippet above is incorrect).
And you should see an error message in Atlassian-Jira.log right after displaying an issue that should show your calculated field.
Finally, you can use Java Date methods to get the current date as well as to add to a date.
Might be worth explaining
It should be, but you'll need to tell us more about what you're trying.
We probably still need to see the error message.
Thanks, was able to implement.
Thank you for your replies.
Good!
Care to share your solution here?
This works in my case: due date (=current date) + 9 days.
import java.text.SimpleDateFormat; import java.util.Date; SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yy"); Date dt = new Date(); long time = dt.getTime()+9*24*60*60*1000; String duedate = sdf.format(time);
duedate.jpg
pf.jpg
Actually, something like:
import org.apache.commons.lang3.time.DateUtils; return DateUtils.addDays(new Date(), 9);
would be simpler.
It looks like you're new here. Sign in or register to get started.