Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Set up Issue link (Confluence page type) by Java API

 

Hi guys,

We intend to set up a issue link to confluence page by Java API, as following:

微信图片_20180114211227.png


And we find some Java APIs available for JIRA Issue but not for Confluence page, such as:

IssueLinkManager,IssueLink.

Could somebody please help us, give us some help?

Thanks in advance.

3 answers

I have the same problem. I'm using ConfiForms IFTTT Integration Rules to create Jira Issue, and I want to link that issue to another Confluence page.

Same problem for me, I use two IFTTT. The first is creating the Jira Task and the second should add a confluence page.

Don't get it running.... :(

1. IFTTT

{ "fields": { "project": { "key": "[entry.jiraprojekt]" }, "summary": "[entry.titel]", "description": "[entry.fehlerbild.escapeJSON]", "issuetype": { "name": "Bug" }, "reporter": { "name": "[entry.autor]" } } }

 2. IFTTT

{ "update": { "application": { "type": "com.atlassian.confluence", "name": "Welcome" }, "relationship": "Wiki Page", "object": { "url": "LINK TO PAGE", "title": "Wiki Page", "icon": {}, "status": { "icon": {} } } } }

 

Maybe can figure out the problem? I have search through the whole internet and I don't get it. :D

I want prefer a final code :D

Because it is done differently according to Jira REST APIs - that is why it doe snot work for you with those "updates"

 

See the page I am referencing in my answer - it has a complete code

<ac:structured-macro ac:macro-id="d4d6ee84-0f33-4713-b0c4-04baad175345" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="action">WebService Request</ac:parameter>
<ac:parameter ac:name="extras">4bb4c41a51f289a07507d50a1b841a4d</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">/rest/api/latest/issue/[entry.jk.asJSON.key]/remotelink</ac:parameter>
<ac:parameter ac:name="additionalContext">file</ac:parameter>
<ac:parameter ac:name="extras2">X-Atlassian-Token: no-check;</ac:parameter>
<ac:parameter ac:name="who">POST</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="56a89f71-7d60-496a-ab45-2d6f6db4bd34" ac:name="noformat" ac:schema-version="1">
<ac:plain-text-body><![CDATA[{
"object": {
"url":"https://wiki.vertuna.com/pages/viewpage.action?pageId=[entry._page.id]",
"title":"[entry._page.title.escapeJSON]"
}
}]]></ac:plain-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>

Contents you need to POST and the API endpoint you need to use

Like Michael Küng likes this

Thanks @Alex Medved _ConfiForms_ !

I will try it, unfortuately I'm just an "user" and our IT have blocked the webservice requests. But I will get further with your helpful comment.

Does not have to be a web service request!

You can do the same through the "AppLink Service" IFTTT action!

(Assuming you have connected your Jira to Confluence through the app links) 

Like Michael Küng likes this

OMG! It works, thank you some much!

I had to change the Service from "/rest/api/latest/issue/[entry.jk.asJSON.key]/remotelink"

to "/rest/api/latest/issue/[entry.jk]/remotelink", than it was working, before the entry was not working and I got the following message back 

java.lang.IllegalArgumentException: Refusing to sign non-normalized URL: http://home/jira/rest/api/latest/issue//remotelink

Thanks Alex, great support!

For ConfiForms you need to setup another IFTTT to call the Jira REST API to setup such link (can user applink service or web service connection types of IFTTTs) - see complete example on how to create a remote link to Jira with ConfiForms on our wiki

 

(Sorry, should have answered this under the @Parvaneh Zand question)

Hi, Alex.

Your example works fine. But I have an issue with the link type. Currently the link type is "remotelink" but NOT Wiki Page link. How can I change the type?

Unfortunately the Structure Addon doesn't recognize remote links to Confluence and demands a Wiki Page link type. Thanks!

linktype.png

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you