Hello,
I want to set automatically due date to be the last day of the month. Is there a script for scriptrunner with which to do it?
Thank you in advance
Hi @Kristiyan Nachov ,
you can without a doubt script that (as a behaviour or postfunction, based on your needs), and you can find a lot of info about working with dates here.However, if scripting does not come easy to you, you might want to try automation for jira (there is a free lite version for server) where you can add a trigger, and then edit the issue with
duedate = {{now.lastBusinessDayOfMonth}} <br>or <br>duedate = {{now.endOfMonth}}
hope this helps,
- Tessa
I apologize but I did not explain well. I want the default value of the field Due Date to be the last day of the month. This is the script we used in the previous version of the Jira.
<script type="text/javascript">var monthNames = ["Jan", "Feb", "Mar","Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct","Nov", "Dec"];
var today=new Date();var dd=today.getDate();var mm=today.getMonth()+1; //January is 0!var yyyy=today.getFullYear().toString();var res = yyyy.substring(2, 4);var dd = new Date(yyyy, mm, 0);var d = dd.getDate();
today=d+'/'monthNames[mm-1]'/'+res;
dueDateField = AJS.$("#duedate");
if (!dueDateField.val())
{ dueDateField.val(today); }
;
</script>
This script was in description of Due Date field.
However, after we upgraded to version 8.14.1, this is what happened.
You are very right, Javascript in field description is no longer supported from Jira 8+.Might have mentioned these things right away for quicker resolution
As I mentioned before, you should use a behaviour with groovy script to do this from now on. Ping if you need a little help with the scripting, but Adaptavist has extensive info available to set you on the right track.
Good luck!
Thank you very much.
I am starting to explore adaptavist.
It looks like you're new here. Sign in or register to get started.