Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I see what version of Confluence Questions I have?

Frank Connolly
January 15, 2019

I can see the version of Confluence I am running via the ? Help icon > About, however, I can not find where the version of Questions is listed. 

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 3, 2018

Hello,

Kindly have a look at this link (there is an example of how you can do it)

https://community.atlassian.com/t5/Answers-Developer-Questions/Making-a-REST-call-using-script-runner/qaq-p/576712

Phil P
January 4, 2018

Using that method and I'm able to send the POST request. But with Unirest after running the Unirest.post function it returns the body of the response :

POST https://devxxxx.service-now.com/api/now/table/change_request asJson Request Duration: 4422ms
status: 201 - Created
body: {"result":{"parent":"","made_sla":"true","caused_by":"",....}}

 I seem to be unable to retrieve the response body using HttpURLConnection

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 4, 2018

I think connection.getResponseMessage() should get the response.

Phil P
January 4, 2018

connection.getResponseMessage() was returning sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@69c728b9

 

I had to buffer the input stream to read it properly:

def inputStream = connection.getInputStream();

BufferedReader input = new BufferedReader(
new InputStreamReader(
inputStream));

StringBuilder response = new StringBuilder();
String currentLine;

while ((currentLine = input.readLine()) != null)
response.append(currentLine);

input.close();
response.toString();

 This gave me the same output as using Unirest.

 

Thanks for the help!

awolf2904
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 11, 2020

Not sure why Unirest is not working in ScriptRunner. I tried everything and searched a lot but I couldn't get it to work.

 

BufferedReader & StringBuilder would also work but it looked to complicated.

 

But parsing the inputStream with Groovy JsonSlurper is working for me. Like in the snippet below:

import groovy.json.JsonSlurper;
// ... code from the example

InputStream inputStream = connection.getInputStream();
def json = new groovy.json.JsonSlurper().parse(inputStream);
log.info(json.getAt(0));
0 votes
Artem Grotskyi
July 20, 2021

Use

@Grapes(
@Grab(group='com.mashape.unirest', module='unirest-java', version='1.4.9')
)
import com.mashape.unirest.http.Unirest

Unirest.get("<URL>")
TAGS
AUG Leaders

Atlassian Community Events