Hi all,
As title, Is there any way which I can get sprint end date from story and do the comparison with another story's sprint end date? (prefer using Post-function or Script filed) Thank you very much!
Best Regards,
same as above script but instead of issue.{method} will have to fetch current issue's epic as issue and run sprint method as same as above script
I'll just post script to convert current issue's epic(if associated) as issue object
def issueManager = ComponentAccessor.issueManager
def epicLink = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Epic Link")
def epic = issue.getCustomFieldValue(epicLink) as String
if(epic){
def epicIssue = issueManager.getIssueObject(epic)
}
Let me know if you need assistance still
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kris Han,
In Post-function you can use below code for getting sprint's end date
you can get it's state to verify whether it's active or not
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.greenhopper.service.sprint.Sprint
def cfSprint = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Sprint")
def currentSprint = issue.getCustomFieldValue(cfSprint) as List
def sp = currentSprint?.last() as Sprint
def endDate = sp.getEndDate()
here issue is current issue on which transition happened
to work on another issue's date and fields use below code to get another issue object by using it's key and once you have both issues sprint end date you can make a comparison
def anotherIssue=ComponentAccessor.getIssueManager().getIssueObject("JIRA-12")
Hope this gives you some idea
BR,
Leo
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.