I have following code for getting the attached Confluence pages in an issue:
[jira.customfield_remotelink]
data_type = "string"
name = "Confluence-pagina"
dimension = true
multiple_values = true
split_by = ","
javascript_code = '''
var newlist = new Array;
getDocument("issue/"+ issue.key + "/remotelink", {ignoreErrors: [404]}, function(result){
if (result) {
for (var i = 0; i < result.length; i++) {
relationship = result[i].relationship;
if(relationship){
newlist.push(result[i].object.url);
issue.fields.customfield_remotelink = newlist.join(",");
}
}
}
});
'''
and for making it an active link:
CASE WHEN
NOT IsEmpty([Measures].[Issue Confluence-pagina])
AND
[Measures].[Issue Confluence-pagina] <> "(none)"
THEN
"[Link Confluence]"
||"("
||Cast([Measures].[Issue Confluence-pagina] as string)
||")"
END
Now I was wondering if I can do the same for the attached forms.
I want to achieve a report where the user can click on the link to open the attached form instead of going to the issue.
As Dirk mentioned, above code is to retrieve the link (and make it clickable) from attached Confluence pages in a ticket. I would like to do the same for attached form in tickets.
I’m not familiar what is “attached form in tickets”
Can you explain how you attach a form to the ticket? Is that part of Jira inbuilt functionality?
Is there some plugin required to attach a form to the ticket?
I found an API and a way to get the form details for one Jira issue per request using additional Rest API request, but the problem is that each combination (issue&form) has unique formID which makes it impossible to retrieve all the form details for all issues using just one Rest API request. There has to be two requests for each issue. First is getting the form ID, the second is getting data from particular form ID.
And even if you could teach eazyBI how to run two getDocument requests (it would be very slow data import) you can not “post” HTTP header for getDocument requests.
You can not run this form API without HTTP header value “opt-in”
In short, unfortunately, how it is possible while the Atlassian changes their APIs