Hi,
I have two fields Date 1 and Date 2, I would like to subtract these fields for example {Date 1} - {Date 2} and return the value in days or number is it possible?
I have scriprunner and I'm trying to use it.
This depends on what you are hoping to do with the returned value in days. this is a simple script you can run in the console that will give you the difference between the created and duedate in days
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
IssueManager issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject("IssueKeyHere")
def dueDate = issue.getDueDate()
def createdDate = issue.getCreated()
dueDate - createdDate
Just remember that this might not work for custom fields as Jira stores them differently
You might find this similar post useful - How-to-calculate-number-of-days-between-two-system-fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.