POST script in SIL

Ivan D August 13, 2021


I'm noobie in SIL and I need to create a http POST request to send on transition some issue fields to a DB server and to get confirmation it's delivered.

The DB admin provided me with a connection string like:

curl -location -request POST '<issue key>/updateinfo' \
--header 'Authorization: Basic abCDefghjk' \
--header 'Content-Type: text/plain' \
--data-raw '{Test:True}'

The data to send can be in JSON.

My code is:


struct property { 
 string property; 
 string value;
struct properties { 
 property [] properties;
struct returnData { 
 string status; 
 string issueId;
property [] propertyArray;
property p;
properties newIssue; = "Type";
p.value = "{{}}";
propertyArray += p; = "Data1";
p.value = "{{customfield_11111}}";
propertyArray += p; += propertyArray;
string username = "user";
string password = "password";
HttpRequest request;
HttpHeader header = httpCreateHeader("Accept", "application/json");
request.headers += header; 
header = httpBasicAuthHeader(username, password);
request.headers += header; 
header = httpCreateHeader("Content-Type", "application/json");
request.headers += header;
41 returnData result = httpPost("{{issue.key}}/updateinfo/", request, newIssue); 
return result.status;

Error is: Exception while executing SIL program >>null<<: [SIL Error on line: 41, column: 21] null

Appreciate any help.



1 answer

1 accepted

0 votes
Answer accepted
Ivan D September 14, 2021

A solution is found.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events