Created
June 26, 2017 17:25
-
-
Save antoviaque/66c32e4e7c60e10f2597f8466108ecb3 to your computer and use it in GitHub Desktop.
Jira - ScriptedField - Ready for Sprint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.issue.CustomFieldManager | |
import com.atlassian.jira.issue.fields.CustomField | |
// Main ////////////////////////////////////////////////////////////////////////////// | |
if(issue.issueType.name != "Story" && issue.issueType.name != "Bug") { | |
return null | |
} | |
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager() | |
CustomField customFieldReviewer1 = customFieldManager.getCustomFieldObjectByName("Reviewer 1") | |
def reviewer1 = issue.getCustomFieldValue(customFieldReviewer1) | |
CustomField customFieldStoryPoints = customFieldManager.getCustomFieldObjectByName("Story Points") | |
def storyPoints = issue.getCustomFieldValue(customFieldStoryPoints) | |
def assignee = issue.getAssignee(); | |
if(assignee && reviewer1 && storyPoints) { | |
return 1; | |
} else { | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment