In the following script if the "searchCriteria" returns a ticket I then need to get the "Workitem Type" from that found ticket to display in the current ticket (as part of the string header) . Is that possible to do?
I found a potential solution by iterating through all of the possible 'Workitem Types' but that seems to be resource intensive and then I get many unnecessary links on my current Jira ticket.
package HOL.webFragments
import com.atlassian.jira.issue.Issue
import static com.bloomberg.dtjira.Environment.*
import static com.bloomberg.dtjira.Utility.*
import static com.bloomberg.dtjira.Links.*
import com.bloomberg.dtjira.link.BaseLinkBuilder
class Links extends BaseLinkBuilder {
@Override
void doGenerate(Writer writer, Issue issue) {
String alternateIssueId = values(issue, "Alternate Issue ID")[0]
String issueKey = issue.getKey()
values(issue, 'Ticker').forEach {
simpleLink(writer, 'Function Link', "${it} Equity ${PHDC[env]}", 'Launch PHDC')
}
String holSummary = "US5 PSTK Update"
if (issue.getSummary().contains(holSummary)) {
String searchCriteria = "project = 'HOL' AND 'Alternate Issue ID' ~ '${alternateIssueId}' and summary ~ 'US5 PSTK Update' and key != '${issueKey}'"
String header = "Tickets Bundled by Workitem ID:"
jqlLink(writer, searchCriteria, 5, true, header)
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.