Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.94 KB | None | 0 0
  1. import com.atlassian.jira.component.ComponentAccessor
  2. import com.atlassian.jira.issue.CustomFieldManager
  3. import com.atlassian.jira.issue.Issue
  4. import com.atlassian.jira.issue.fields.CustomField
  5. import com.atlassian.jira.issue.link.IssueLink
  6.  
  7. IssueLink issueLink = issue.get("issuelinks").first() { IssueLink il ->
  8.     //if you're looking for the first issue that the current issue "blocks".
  9.     // Note that if you wanted the opposite (is blocked by), you'd need to replace "Outward" by "Inward" here and "getDestinationObject" by "getSourceObject" below
  10.     return il.getIssueLinkType().getOutward().equals("blocks");
  11. }
  12. if (issueLink==null)
  13.     return null
  14. Issue linkedIssue = issueLink.getDestinationObject()
  15.  
  16. final CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
  17. final CustomField customField = customFieldManager.getCustomFieldObject("customfield_11505")
  18.  
  19. return linkedIssue.getCustomFieldValue(customField)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement