<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Jira Align REST call, pagination, and foreign keys in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Jira-Align-REST-call-pagination-and-foreign-keys/m-p/2514988#M22092</link>
    <description>&lt;P&gt;Need help on collecting data from Jira Align. I want to get User and related Team data. I loop with pagination but the "__KEY_root" is repeated for every hundred records. Each pass restarts the key at 0. This renders the FK useless. I want to end up with two tables; a user table and a lookup table with the teams that user is a member of.&lt;/P&gt;&lt;P&gt;User: column 1 = user_id, column 2 = __KEY_root&lt;/P&gt;&lt;P&gt;Team: column 1 = team_id, column 2 = the same&amp;nbsp;__FK_root from above&lt;/P&gt;&lt;P&gt;The result would be a one (user) to many relationship (teams).&lt;/P&gt;&lt;P&gt;How do I solve?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;DO&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"id",&lt;BR /&gt;"fullName",&lt;BR /&gt;"status",&lt;BR /&gt;"__KEY_root",&lt;BR /&gt;(SELECT&lt;BR /&gt;"teamId",&lt;BR /&gt;"teamName",&lt;BR /&gt;"__FK_teams"&lt;BR /&gt;FROM "teams" FK "__FK_teams")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;BR /&gt;WITH CONNECTION (URL "$(vBaseURL)?top=$(vTop)&amp;amp;skip=$(vSkip)");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LET vTotal = peek('id', $(vSkip), 'RestConnectorMasterTable');&lt;BR /&gt;LET vSkip = $(vSkip) + $(vTop);&lt;BR /&gt;LET OldRowCount=rowCount;&lt;BR /&gt;LET rowCount = NoOfRows('RestConnectorMasterTable');&lt;/P&gt;&lt;P&gt;LOOP WHILE rowCount &amp;gt; OldRowCount;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erieqlik_0-1745265483631.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179761iC5A2A0488FAAC756/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erieqlik_0-1745265483631.png" alt="erieqlik_0-1745265483631.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Apr 2025 19:58:37 GMT</pubDate>
    <dc:creator>erieqlik</dc:creator>
    <dc:date>2025-04-21T19:58:37Z</dc:date>
    <item>
      <title>Jira Align REST call, pagination, and foreign keys</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Jira-Align-REST-call-pagination-and-foreign-keys/m-p/2514988#M22092</link>
      <description>&lt;P&gt;Need help on collecting data from Jira Align. I want to get User and related Team data. I loop with pagination but the "__KEY_root" is repeated for every hundred records. Each pass restarts the key at 0. This renders the FK useless. I want to end up with two tables; a user table and a lookup table with the teams that user is a member of.&lt;/P&gt;&lt;P&gt;User: column 1 = user_id, column 2 = __KEY_root&lt;/P&gt;&lt;P&gt;Team: column 1 = team_id, column 2 = the same&amp;nbsp;__FK_root from above&lt;/P&gt;&lt;P&gt;The result would be a one (user) to many relationship (teams).&lt;/P&gt;&lt;P&gt;How do I solve?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;DO&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"id",&lt;BR /&gt;"fullName",&lt;BR /&gt;"status",&lt;BR /&gt;"__KEY_root",&lt;BR /&gt;(SELECT&lt;BR /&gt;"teamId",&lt;BR /&gt;"teamName",&lt;BR /&gt;"__FK_teams"&lt;BR /&gt;FROM "teams" FK "__FK_teams")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;BR /&gt;WITH CONNECTION (URL "$(vBaseURL)?top=$(vTop)&amp;amp;skip=$(vSkip)");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LET vTotal = peek('id', $(vSkip), 'RestConnectorMasterTable');&lt;BR /&gt;LET vSkip = $(vSkip) + $(vTop);&lt;BR /&gt;LET OldRowCount=rowCount;&lt;BR /&gt;LET rowCount = NoOfRows('RestConnectorMasterTable');&lt;/P&gt;&lt;P&gt;LOOP WHILE rowCount &amp;gt; OldRowCount;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erieqlik_0-1745265483631.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179761iC5A2A0488FAAC756/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erieqlik_0-1745265483631.png" alt="erieqlik_0-1745265483631.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 19:58:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Jira-Align-REST-call-pagination-and-foreign-keys/m-p/2514988#M22092</guid>
      <dc:creator>erieqlik</dc:creator>
      <dc:date>2025-04-21T19:58:37Z</dc:date>
    </item>
  </channel>
</rss>

