Condition Existence of a Confluence Link

Todd Winton January 27, 2017

We have requirements for there to be documentation in confluence of change requests. Is it possible to have a workflow condition to verify the existence of a confluence link?

2 answers

3 votes
Rafael Franco
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2017

Hi Todd,

In order to help you, we need to understand what do you mean by Confluence Link, is to check if there's a Confluence Application Link between JIRA and Confluence or verify if a page exists?

Regards,

Rafael

Todd Winton January 30, 2017

This is to verify the existence of a link to a confluence page.  

Rafael Franco
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 30, 2017

Yes Todd, but specifically what kind of link? How do you know if a link exists? does it give a 404 when it doesn't?

Todd Winton January 31, 2017

We have the requirement for certain issue types that documentation be created in confluence and linked in the issue.  We want to verify that a link to a confluence page exists in the issue. 

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2017

To just check for the presence of an app link you can use:

import com.atlassian.applinks.api.ApplicationLink
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
import com.atlassian.sal.api.component.ComponentLocator

def applicationLinkService = ComponentLocator.getComponent(ApplicationLinkService)
final ApplicationLink conflLink = applicationLinkService.getPrimaryApplicationLink(ConfluenceApplicationType)
conflLink as boolean
Todd Winton February 1, 2017

Jamie,

We have the requirement for certain issue types that documentation be created in confluence and linked in the issue.  We want to verify that a link to a confluence page exists in the issue. 

Rafael Franco
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2017

Todd,

Did you try to use the REST api to query that? https://docs.atlassian.com/atlassian-confluence/REST/latest/#content-getContent

Todd Winton February 1, 2017

No I have not.  There is built in the script to verify the existence of a duplicate issue link from script runner: issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains.('Duplicate').  How can I use something similar to verify that an issue link exists at all?

Todd Winton February 17, 2017

Rafael,

There is built in the script to verify the existence of a duplicate issue link from script runner: issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains.('Duplicate').  How can I use something similar to verify that a link to an an issue or a confluence page exists at all?

Suggest an answer

Log in or Sign up to answer