Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,329
Community Members
 
Community Events
176
Community Groups

POST script in SIL

Edited

Hello,

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 'https://xxxxx.yyyyy.org/db/hs/tikets/<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;
 
p.property = "Type";
p.value = "{{issues.issueType.name}}";
propertyArray += p; 
p.property = "Data1";
p.value = "{{customfield_11111}}";
propertyArray += p; 
newIssue.properties += 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("https://xxxxx.yyyyy.org/db/hs/tikets/{{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.

BR,

Ivan

1 answer

1 accepted

0 votes
Answer accepted

A solution is found.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events