Forums

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

Notification of Questions Asked?

Burke Autrey
Contributor
September 22, 2015

Some of our users get notified by email when a question is asked in Questions but others don't.  Which notification setting controls this?

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Daniel Yelamos [Adaptavist]
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.
May 30, 2018

Hi

Try this:

Add this import:

import groovy.json.JsonBuilder

 And this line before the comment that reads "API POST"

def finalJSON = new JsonBuilder(jsonBody).toString()).build()

That should output the JSON in the proper format.

Do say if I can help you further.

Cheers!
DYelamos

Andrew Downs
May 31, 2018

Thank you for the assist. Managed to get it working. Appreciate the help.

 

I ended up getting the concatenation working as base and it posts successfully. But will look at your code as well for a more robust method I think.

Daniel Yelamos [Adaptavist]
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.
May 31, 2018

Thanks:

Could you mark this answer as accepted so that other users know that this thread has been answered?

Do say if I can help you further.

Cheers
DYelamos

Vineela Durbha
Contributor
April 23, 2019

Hi @Andrew Downs 

I am trying to update a request using the your code

def body = [:]
body.put("IssueNumber","XCAP-688")
body.put("Priority","P4 (No Impact/Notify)")


def baseUrl = new URL("http://xxx/xxx/UpdatePriority");

HttpURLConnection connection = baseUrl.openConnection() as HttpURLConnection;
connection.requestMethod = "POST"
connection.doOutput = true
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8")
connection.outputStream
connection.outputStream.withWriter("UTF-8") { new StreamingJsonBuilder(it, body) }
connection.connect();

log.info ("URL=" +baseUrl +" Status= "+connection.getResponseCode() as String)

 

But it is throwing 500 error(whereas there is no issue with the api.Not sure why is it giving 500 error). If i am trying to pass json data as below I am getting 400 error

def body = """{"Priority": "P4 (No Impact/Notify)", "IssueNumber": "XCAP-688"}"""

 

Can you help me in passing json data

TAGS
AUG Leaders

Atlassian Community Events