How to validate a link (a confluence link, Wiki Page) to transition an issue.
[I mean I just to check a wiki page, issue should not go to next state without a confluence link]
any chance by using scriptRunner
Thanks
Dave
What exactly do you want to validate? Response from Confluence or that it's a link?
I want to verify that at least one confluence page is linked.
wiki page link.png
import com.atlassian.applinks.api.ApplicationLinkService import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType import com.atlassian.jira.bc.issue.link.RemoteIssueLinkService import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.link.RemoteIssueLink import com.atlassian.jira.user.ApplicationUser import org.apache.log4j.Logger static boolean hasAnyRemoteConfluenceLink(ApplicationUser user, Issue issue, Logger log = null) { def applicationLinkService = ComponentAccessor.getComponent(ApplicationLinkService) def remoteIssueLinkService = ComponentAccessor.getComponent(RemoteIssueLinkService) def conf_link = applicationLinkService.getApplicationLinks(ConfluenceApplicationType)?.first() if (!conf_link) { log?.error "No confluence application link found." return false } return remoteIssueLinkService.getRemoteIssueLinksForIssue(user, issue)?.remoteIssueLinks?.any{it.applicationType == RemoteIssueLink.APPLICATION_TYPE_CONFLUENCE} } hasAnyRemoteConfluenceLink(ComponentAccessor.jiraAuthenticationContext?.loggedInUser, issue)
Hi Tej, did you manage to do this? Would be grateful if you could share an updated script !
It looks like you're new here. Sign in or register to get started.