The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Resolution Date: Only Date Not Date and Time

Nick H
Contributor
July 5, 2022

I am trying to create a JMCF field that looks at the "Due Date" of an issue and the "Resolved Date" of an issue. The custom field would be called "In SLO?" As you can imagine if the resolved date is greater than the due date we want the field to print "no" or "false." That part seems easy.. we have the following expression:

issue.get("duedate") >= issue.get("resolutiondate")

The issue is the due date field only pulls in mm/dd/yyyy and resolution pulls as mm/dd/yyyy hh:mm:ss. We do not want to change either fields set up but we need a way to change the expression above to only compare the mm/dd/yyyy portion of the dates as some issues are being marked as "false" because they are being resolved on the same day as the due date. For example, one issue has a due date of 07/01/2022 and was resolved 07/01/2022 09:01:23 and is being marked as "false" when really, for our purposes, that should be marked as true. 

We do not want to import any scripts either, we just hope to be able to edit the one above. 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Alex Koxaras -Relational-
Community Champion
July 5, 2022

Hi @Nick H 

Did you try formatting the resolution date?

issue.get("duedate") >= issue.get("resolutiondate").format("yyyy/MM/dd")

The above format might not be appropriate. Try others like "dd/MM/yyyy", or whatever format the due date yields.

 

Regards,
Alex

Nick H
Contributor
July 5, 2022

Thanks Alex! That did it! 

Like • Alex Koxaras -Relational- likes this
Alex Koxaras -Relational-
Community Champion
July 5, 2022

Good to know that!