Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hhajjali
Contributor III
Contributor III

What goes wrong with Jira rest connector?

Hello,

Since last Jira update, the maxResults is passed to 100 instead of 1000 earlier.

Jira uses  offset, with startAt to identify the record where to begin, maxResults to determine how much records and  root/total for the total results in the query.

So I am using pagination with offset to try to retrieve 558 records from jira, with 50 records each page.

I have configured the rest connection and injected the script to load data, bellow you may found the screen shots, authentification schema is basic with a login and a password.

The URL is a basic rest API call (I deleted the url of the server bellow).

rest/api/latest/search?&jql=project =ANO &fields=Key,summary,fixVersions,customfield_10104,priority,customfield_10100,customfield_10103,versions,status,components,customfield_10604,issuetype,resolutiondate,created,customfield_11605,customfield_12000,customfield_12002

My problem is that I can not get all data. In my case, the rest connector should retreive 12 pages of data. When loonking to imported data I have the impression that it load 12 time the first page.


Do you have encouter a similar problem ?

Any ideas?

Thanks for your help.

Sans titre.png

Sans titre.png

Sans titre.png

1 Solution

Accepted Solutions
hhajjali
Contributor III
Contributor III
Author

Hello,

I tried to use custom pagination and create logic in load script to create different pages to load:

The vMyUrl is well structured because I copied it values from the trace and test it in navigator.

But still QLik give me the same results, I think it send request ignoring the startAt and maxResults... Even by forcing the parameters startAt=100 and maxResults=10, it load first 50 records and starting from position 0.

Do you how to debug the message sent from Qlik Sense? Wireshark would work ?

Thanks for your help.

Sans titre.png

A helpful page: https://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/1.0/Create-REST-connec...

View solution in original post

5 Replies
hhajjali
Contributor III
Contributor III
Author

Hello,

I tried to use custom pagination and create logic in load script to create different pages to load:

The vMyUrl is well structured because I copied it values from the trace and test it in navigator.

But still QLik give me the same results, I think it send request ignoring the startAt and maxResults... Even by forcing the parameters startAt=100 and maxResults=10, it load first 50 records and starting from position 0.

Do you how to debug the message sent from Qlik Sense? Wireshark would work ?

Thanks for your help.

Sans titre.png

A helpful page: https://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/1.0/Create-REST-connec...

hhajjali
Contributor III
Contributor III
Author

I have found root cause of the problem but not yet the solution.

The URL I am giving to contain a JQL request in which I have a jira custom field. The custom field name is composed of 2 words "Feature Team".

Usually the JQL can be like : projet=ANO and "Feature Team"=TEAM1&startAt=0&maxResults=100.

This JQL work correcly in navigator or any other rest reader program.

In qlik sense it ignores all what I wave after the double quotes (").

I have tested my second comment script without "Feature Team" and it working great.

So the problem now, do you know how can I ignore double quotes in variables in load script?

Thanks for your help.

hhajjali
Contributor III
Contributor III
Author

To ignore double quotes ", all what you hace to do is to add another double quotes " --> ref Oracle Loader documentation.

So my second responses is the correct answer to my problem, and extra hints in this comment.

Anonymous
Not applicable

Hi Haj Ali

Did you ever get this working correctly? I'm trying to do the same but my results are limited to the first 50 records no what what I try.

It doesn't look like my API call works when I use the startAt and MaxResults values. I thought it may have been down to my use of the " character or the user of the '-' in the issuetype name in the search criteria of the query:

http://jira/rest/api/2/search?jql=issuetype%20=%20"THIS%20-%20PROJECT"%20and%20assignee%20=%20"User1...

I haven't tried the custom pagination yet, I just want to check if my query is right first before I try again.

Any help is appreciated.

Regards

Anonymous
Not applicable

One other thing, in the for loop you need to use $ expansion for total i.e. $(total), also use the Next statement at the end of the loop to continue on.

Great work though Haidar, this was a really helpful article, so good to read something that's straight forward, all on the one thread and not loaded with comments from other users giving multiple links to other articles