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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Jira query to create an issue with relate to

Edited

HI there

 

I am trying to create a jira issue using IFTTT Integration Rules within confiform, what I need help is how to set issuelinktype relate to with list of epics that entered by the user in confifrom

 

in Confiform I have the following fields 

summary, priority, relateTo <-- this is list of jira issues/epics

 

This is what I have 

 

{

"fields":

{

"project": { "key": "XYZ" },

"priority": { "name": "[entry.priority.label]" },

"summary": "[entry.summary]",      

"issuetype": { "name": "Task" }

}

}

 

wondering how I can add Relate To within Issue Link Type

 

thanks 

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
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.
Sep 28, 2023

Hi @Markisio 

Do you know how the "relateTo" is set in Jira REST API? What is this? is this an issue links or a special custom field?

Alex

hi @Alex Medved _ConfiForms_ 

sorry relateTo is a confiform field in confluence, I am using data from confiform to create jira ticket, what I want to add the value from confiform field (relateTo) to Jira issue/ticket under Issue Links --> relates to. screen shot below from jira

I think that's the field in jira  issueLinkType = "relates to" , don't think its custom field 

Screen Shot 2023-09-28 at 12.15.15 PM.png

Alex Medved _ConfiForms_
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.
Sep 28, 2023

I think this answers your question https://confluence.atlassian.com/jirakb/how-to-use-rest-api-to-add-issue-links-in-jira-issues-939932271.html or at least gives an idea on how to set it up

thanks @Alex Medved _ConfiForms_ haven't implemented yet, but it helps. However how would that work for list of relateTo, can I do for loop in query?

Alex Medved _ConfiForms_
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.
Oct 03, 2023

Could use Velocity foreach

#foreach(${ticket} in ${jiraTickets.getIds()})
"add":{
"type":{
"name":"Blocks",
"inward":"is blocked by",
"outward":"blocks"
},
"outwardIssue":{
"key":"${ticket}"
}
}

#end

Assuming the field to hold multiple JIra issues is called jiraTickets

Alex 

thanks @Alex Medved _ConfiForms_ 

 

I did the following 

 

#if(${relateTo}) "update":{ "issuelinks":[{ #foreach(${ticket} in ${relateTo.getIds()}) "add":{ "type":{ "name":"Relates", "inward":"relates to", "outward":"relates to" }, "outwardIssue":{ "key":"${ticket}" } }, #end }] }, #end

 

result

 

"update": {
"issuelinks": [{
"add": {
"type": {
"name": "Relates",
"inward": "relates to",
"outward": "relates to"
},
"outwardIssue": {
"key": "X1"
}
},
"add": {
"type": {
"name": "Relates",
"inward": "relates to",
"outward": "relates to"
},
"outwardIssue": {
"key": "X2"
}
}
}]
},

however I am getting Invalid format. Duplicate key "add" :( 

Alex Medved _ConfiForms_
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.
Oct 06, 2023

Well, regarding the JSON format what Jira expects please see the documentation on Jira REST APis... there is not much I can help you with

But the same keys in JSON objects are not possible as per JSON format

hi @Alex Medved _ConfiForms_ 

 

I got it working, however it only works with single ticket, it seems there is an existing issue: https://jira.atlassian.com/browse/JRACLOUD-81845 do you know when that fix so I can use the for loop?

 

{ "fields": { //FIELDS elements } #if(${relateTo}) , "update":{ "issuelinks":[ { "add":{ "type":{ "name":"Relates", "inward":"relates to", "outward":"relates to" }, "outwardIssue":{ "key":"[entry.relateTo.get(0).id]" } } } ] } #end }

Alex Medved _ConfiForms_
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.
Oct 10, 2023

Unfortunately I cannot force Atlassian to fix the bug... Please ask them about it

Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events