Hello Community,
I have been looking for ways to construct a get request inside Jira.
I want to use the rest API inside a Behavior to fetch certain board related data:
<jira Base URL>/rest/agile/1.0/board/{board Id}/configuration
Would anyone know how I can form a get request inside Jira as to receive a response from the url mentioned.
Thank you for your time and expertise!
-Roberto
Hi Roberto.
I recently did an answer on how to use our HTTP request method from inside JIRA to make a request to any link. You can find relevant information in that question.
If you are still struggling. Could I ask you to give me an specific example of what it is that you want to accomplish?
Cheers
Dyelamos
Hi @Daniel Yelamos [Adaptavist],
i read the attached community post.
i tried implementing the solution on my end but I got authorization errors.
i am trying to use a get request to get the information related to a board by passing the board Id to a REST API.
the API is: board/{boardID}/configuration
Do I need to pass my Jira credentials to the http request? If so how can I do so?
i appreciate your help!
-Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Daniel Yelamos [Adaptavist], @Nic Brough -Adaptavist-
I have tried using the examples in the article you sent over in your last response but I have been getting this error:
groovyx.net.http.HttpResponseException: Unauthorized
I am doing the following in my code:
import groovyx.net.http.ContentType
import groovyx.net.http.RESTClient
def boardId = '3';
def activitiRestClient = new RESTClient("<Jira Base URL>/rest/agile/1.0/board/")
activitiRestClient.auth.basic "USERNAME", "PASWORD"
def response = activitiRestClient.get(
path: boardId+'/configuration'
)
output+="\nresponse: "+response+"\n"
Could you provide some pointers as to why this isn't working for me?
Thank you!!
-Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Roberto. If you are getting that response it can mean one of two things:
1. Your request isn't well formed.
2. your username and password are not correct.
The best way you have of testing this would be to use a rest call plugin in firefox or similar, or the terminal if you are well versed and send the petition. Once and only once you get a proper response, compare the packages and see what the difference is. Then you will find why you are getting the auth error.
Cheers
Dyelamos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, I forgot what I did but I ended up solving the issue.
-Roberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.