Hello all,
I have the given script which returns the date of first transition to "In Progress":
package com.onresolve.jira.groovy.test.scriptfields.scripts
import com.atlassian.jira.component.ComponentAccessor
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def created = changeHistoryManager.getChangeItemsForField(issue, "status").find {
it.toString == "In Progress"
}?.getCreated()
def createdTime = created?.getTime()
createdTime ? new Date(createdTime) : null
How to configure the script so it will return only the full day name for example : Monday
Hello! Try
createdTime.toLocalDateTime().getDayOfWeek()
Hi @Aleksandr Chuiko , thanks for answering :)
I am not sure where to put this line in the code?.. can you help me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Somehow so :)
package com.onresolve.jira.groovy.test.scriptfields.scripts
import com.atlassian.jira.component.ComponentAccessor
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def created = changeHistoryManager.getChangeItemsForField(issue, "status").find {
it.toString == "In Progress"
}?.getCreated()
def dayOfWeek = created?.toLocalDateTime()?.getDayOfWeek()
return dayOfWeek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Aleksandr Chuiko Thanks! now I get the day name, but it returns the server machine time and not my local time (there is a gap of 10 hours between them). Do you know how to solve this?
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.