Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ChannaK
Creator

JIRA REST

 

i am trying to download all fields including Custom from JIRA 

i created REST connection

using  with connection

 

WITH CONNECTION(Url "https://productsup.atlassian.net/rest/api/3/issue/85473",
//WITH CONNECTION(Url "https://productsup.atlassian.net/rest/api/3/issue/$(vFileName)",
QUERY "Authorization" "$(vAuthorization)" );

if i use variable it is not working , it is working fine with out variable

Error:

(Connector error: HTTP protocol error 405 (Method Not Allowed):)

i also tried HTTPHEADERS "Authorization" "$(vAuthorization)" );

 

Labels (2)
1 Solution

Accepted Solutions
steeefan
Luminary

What is the value of the variable IssueKeyTable in this code?

 

LET vFileName = Peek('IssueID',$(i),'$(IssueKeyTable)'); 

 

 Try changing this line to:

 

LET vFileName = Peek('IssueID',$(i),'IssueKeyTable'); 

 

View solution in original post

7 Replies
steeefan
Luminary

What is the content of $(vFileName)?

ChannaK
Creator
Author

Hi @steeefan  i am glad you saw my post

 

below my script ,

loop is not repeated first run i saw value in $(vFileName) , but send time i saw blank

 

LIB CONNECT TO 'JIRA_DATA_DOWNLOAD:JIRA_CUSTOM_FIELDS';
 
 
IssueKeyTable:
LOAD
 
    Issues.id as IssueID
FROM [lib://Downloads:Data/15snynMfhN-l13mnfje4cuw9jT9MlDRW7/JIRA_Issues.qvd]
(qvd) 
where match( Issues.id ,'85645','89730','85473');
 
 
// ////'SLS-1211','SLS-1214');
 
 
 
let username = 'abc@productsup.com';
let password = 'abc';
 
LET vAuthorization = 'Basic ' & '$(username)' & ':' & '$(password)';
 
//LET vAuthorization1 = 'Basic '  & '$(password)';
 
 FOR i = 0 TO NoOfRows('IssueKeyTable')-1;
//for i = 0 to 1;
 
     LET vFileName          = Peek('IssueID',$(i),'$(IssueKeyTable)'); 
    
    trace 'printing issueid :' $(vFileName);
    
    sleep 20000;
 
LET vFURL = '$(vURL)'&'$(vFileName)'; 
 
Trace 'Print Trace URL:' $(vFURL); 
IF LEN('$(vFileName)')> 0 THEN 
 
// end if
// next 
 
RestConnectorMasterTable:
SQL SELECT 
"__KEY_root",
(SELECT 
"__FK_fields",
"__KEY_fields",
(SELECT 
"self" AS "self_u22",
"value" AS "value_u4",
"id" AS "id_u16",
"__FK_customfield_12045"
FROM "customfield_12045" FK "__FK_customfield_12045"),
(SELECT 
"self" AS "self_u23",
"value" AS "value_u5",
"id" AS "id_u17",
"__FK_customfield_12047"
FROM "customfield_12047" FK "__FK_customfield_12047")
FROM "fields" PK "__KEY_fields" FK "__FK_fields")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION(Url "$(vFURL)",
QUERY "Authorization" "$(vAuthorization)" );
 
End If
next i
 
[customfield_12045]:
LOAD [self_u22] AS [self_u22],
[value_u4] AS [value_u4],
[id_u16] AS [id_u16],
[__FK_customfield_12045] AS [__KEY_fields]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_customfield_12045]);
 
 
[customfield_12047]:
LOAD [self_u23] AS [self_u23],
[value_u5] AS [value_u5],
[id_u17] AS [id_u17],
[__FK_customfield_12047] AS [__KEY_fields]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_customfield_12047]);
 
 
DROP TABLE RestConnectorMasterTable;
 
 
 
 
 

 

steeefan
Luminary

Does your table IssueKeyTable actually exist or is the data maybe automatically concatenated to the table loaded before that? What is the result of this code, placed right after the IssueKeyTable LOAD:

vDebug = NoOfRows('IssueKeyTable');
TRACE Rows in IssueKeyTable: $(vDebug);
EXIT SCRIPT;
ChannaK
Creator
Author

Hi @steeefan 

please find the results, we have 3 records

ChannaK_0-1703238943945.png

 

 

ChannaK
Creator
Author

Hi @steeefan 

this is loop results and for second record it is not placing any value it BLANK

ChannaK_1-1703239276488.png

 

trace is showing blank for second record, but have 3 records

steeefan
Luminary

What is the value of the variable IssueKeyTable in this code?

 

LET vFileName = Peek('IssueID',$(i),'$(IssueKeyTable)'); 

 

 Try changing this line to:

 

LET vFileName = Peek('IssueID',$(i),'IssueKeyTable'); 

 

ChannaK
Creator
Author

i really surprise why i use $ for table thank you 👀