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.
You might find this similar post useful - How-to-calculate-number-of-days-between-two-system-fields
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.ComponentAccessorimport com.atlassian.jira.issue.IssueManagerIssueManager 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
It looks like you're new here. Sign in or register to get started.