New issue has the assignee field set to "automatic" for default value. How can I obtain the "assign date" value for usage as a value in a scriptrunner(scripted field) to track when time is changed.
You need to use com.atlassian.jira.issue.changehistory.ChangeHistoryManager. Google on that, you should find some examples.
Thank Jamie. I found an example and I am able to get the assignee change history with the following scripts.
import com.atlassian.jira.issue.* import com.atlassian.jira.issue.fields.CustomField import com.atlassian.core.util.DateUtils import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.history.ChangeItemBean def componentManager = ComponentManager.getInstance(); def changeHistoryManager = componentManager.getChangeHistoryManager(); def changeItems = changeHistoryManager.getChangeItemsForField(issue, "assignee"); def firstAssigned; if(changeItems !=null && !changeItems.isEmpty()){ ChangeItemBean ci = (ChangeItemBean) changeItems.get(0); String assigneeName = ci.getFrom(); // name String assigneeFullName = ci.getFromString();// full name def assignedTime = ci.getCreated().getTime(); firstAssigned = assignedTime; }
Is there a possibility to get the user who did the transition?
I also would be very interested
this is who did last update issue
def changeItems = changeHistoryManager.getChangeHistories(issue);return changeItems.get(changeItems.size()-1).getUsername()
<span><a href="https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/changehistory/ChangeHistory.html#getUsername--" target="_blank" rel="nofollow noopener noreferrer">getUsername</a></span>() Deprecated. Use getAuthorObject() instead. Since v5.0.
<span><a href="https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/changehistory/ChangeHistory.html#getUsername--" target="_blank" rel="nofollow noopener noreferrer">getUsername</a></span>()
getAuthorObject()
It looks like you're new here. Sign in or register to get started.