
I need some how to get URL like string form Attachment.
how can i get it using scriptrunner? Jira Server.
May case:
1) doing JQL and from result - choose first issue with index 0.
2) from result issue trt to get attachment
3) from attachmetn try to get URL (content or thumbnail)
some part of a code below:
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchService = ComponentAccessor.getComponent(SearchService)
String jqlSearch = "project = info and (cf[$cfId3] ~ \"$currentUserName\") "
Query query = jqlQueryParser.parseQuery(jqlSearch)
SearchResults results = searchService.search(fromUser,query, PagerFilter.getUnlimitedFilter())
if (results.total == 0) {
return log.debug("Got error resultJQL = " + results.total + fromUser + currentUserName)
}
ArrayList issues = results.results.collect {issueManager.getIssueObject (it.id)} /
MutableIssue infoIssue = ComponentAccessor.getIssueManager().getIssueObject(issues[0].toString())
def thumbnailsURL = ThumbnailManager.getThumbnails(infoIssue, fromUser).getImageURL() as String //here i got some problem