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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
however I am getting Invalid format. Duplicate key "add" :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately I cannot force Atlassian to fix the bug... Please ask them about it
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.