Getting the linked forms in the issues to show in EazyBI

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.

Hi @_P3

Which Confluence cloud app do you use to attach forms to pages?

Martins / eazyBI support

Hi Martins,

The forms mentioned are those linked to a specific Jira ticket.

Kind regards,
Dirk

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 got the syntax from Import wiki page link into eazybi, where @gerda.grantina did this explanation.

1 Like

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?

Martins

This form was generated from jira service management

afbeelding

Thanks @_P3

Is that Confluence for Data center or Confluence Cloud you are asking about?

Martins / eazyBI staff

Hi @martins.vanags

Everything is cloud

I checked my Jira Cloud site and the Jira SM forms have completely different APIs
https://developer.atlassian.com/cloud/forms/rest/intro/#using-the-rest-api

You can’t access them using the same method getDocument(“issue/”+ issue.key + “/remotelink”…)

Unfortunately, we don’t have any experience yet on how to retrieve data from the form responses for each particular issue.

Please share your insights here if you find api endpoint to get the form results for each particular issue (if that is your goal).

Martins / eazyBI

Hi,

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

Martins / eazyBI





Thank you for the effort.
I hoped forms acted the same as Confluence links, but as you pointed out they don’t.