Skip to content

Instantly share code, notes, and snippets.

@jechlin
Created February 9, 2015 14:27
Show Gist options
  • Save jechlin/fba09a3c317de8d6bc63 to your computer and use it in GitHub Desktop.
Save jechlin/fba09a3c317de8d6bc63 to your computer and use it in GitHub Desktop.
def issue = ComponentAccessor.getIssueManager().getIssueObject("JRA-1")
def beanBuilderFactory = ComponentAccessor.getOSGiComponentInstanceOfType(BeanBuilderFactory.class)
def issueBeanBuilder = beanBuilderFactory.newIssueBeanBuilder(issue, IncludedFields.includeAllByDefault((List) null))
JiraBaseUrls jiraBaseUrls = (JiraBaseUrls)ComponentAccessor.getComponent(JiraBaseUrls.class);
UriBuilder uriBuilder = UriBuilder.fromPath(jiraBaseUrls.restApi2BaseUrl());
def issueBean = issueBeanBuilder.uriBuilder(uriBuilder).expand("").build()
log.debug new DefaultJaxbJsonMarshaller(true).marshal(issueBean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment