Hi Team,
I am on jira server (8.7.1), and available addons are JMWE, scriptrunner, JSU, etc. I am trying to achieving through JMWE (Set Field Value function), but i did not find any date function on within 24 hours of creation date.
The requirement is,
If Need By Date is within 24 hours of Creation date, then Escalation? field must equal 'Yes'.
I am trying with issue.get("Need By Date") == (new Date().clearTime() >= -24h
Could anyone please help on this correct function ?
Thanks!
Hi @Lakshmi S ,
you can use this code as the conditional execution script of the Set Field Value post-function:
issue.get("Need By Date").time < (new Date()).time + 24*60*60*1000
The value of the post-function is Yes, and of course the field is Escalation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you output those two values to the log file what do they say?
You may be comparing a string object with a date object which will never be equivalent
This would only work if the date was exactly 24h ago.... you probably want two date objects and want to check if the date set is equal to or less than to +24 hours.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aiden Marriott ,
No, we are not comparing string object with date. The date custom field (Need By date) is within 24 of ticket creation date, then change the "Escalation" field value to YES in the ticket.
If Need By Date is within 24 hours of Creation date, then Escalation? field must equal 'Yes'.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.