Hello, I am trying to create a escalation script that will calculate the number of days an issue has been in the current status based on the last updated date. I am having problems with
a) Getting the last updated date
b) Passing a variable to the issueInputParameters
Any thoughts or suggestions are appreciated. The code snipet is below:
Thank you!
import org.joda.time.Days
import org.joda.time.LocalDate
def days = Days.daysBetween(LocalDate.fromDateFields(issue.getCreated()), LocalDate.fromDateFields(new Date())).getDays()
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'SLA Escalation'}
issueInputParameters.addCustomFieldValue(cf.id, days)
Thank you all for the suggestions. The scripted field worked well for tracking the number of days in a status. However the scripted field does not appear for selection in a two dimensional widget. Any suggestions?
Hey,
If you are using Script Runner plugin, there is in-built Escalation Service module which helps your need.
You can add your own JQL and custom script for additional issue actions.
Hope this helps
Thanks
Chander Inguva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your response.
We looked at the default options and they do not meet our need. We are looking to track how many days behind the SLA we were for specific transitions. For example, if the requirements need to be approved in 5 days, then we want a field to track the number of days it is delayed past the five days and we want to hold on to this information through the course of the project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My guess is to use a Scripted field (date time field) and use JQL issuefunction on that field to calculate duration (< -5d)
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.