Dear All,
I would like to call external rest api of azure devops from JIRA cloud.For example to create release from JIRA cloud workflow in azure devops
I am trying to use scriptrunner groovy script for this and using httpclient for this but unable to find this package on JIRA cloud
Can you please advice and suggest is it technical possible to call external rest apis from JIRA cloud ?
Thank you
Jawad Haider
Hi Jawad,
Thank you for your question.
I can confirm that that is possible to interact with external applications with ScriptRunner for Jira Cloud as long as the third party application has a Rest API which can be called from ScriptRunner for Jira Cloud.
We have created a Knowledge base article located here which explains in further detail what process should be used to interact with a third party application using ScriptRunner for Jira Cloud.
I hope this information helps.
Regards,
Kristian
I am trying to do this in console
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.1')
import grooxyx.net.http.HTTPBuilder
But getting error :
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org/apache/ivy/plugins/resolver/DependencyResolver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have any example how to call external rest api through groovy script in scriptrunner?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jawad,
Thank you for your response.
Please note the KB article linked contains a link to the sample here which shows how to post a message to slack.
Also please note ScriptRunner uses UniRest so your Rest API call will need to be in this structure and as mentioned in the KB article you will need to contact the vendor of the third party application to ask them to advise on how to call their application.
Regards,
Kristian.
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.
Getting this error now
RunResultLogsorg.codehaus.groovy.runtime.InvokerInvocationException: Assertion failed: postToSlack. Values: postToSlack = null at ConsoleScriptExecution1_groovyProxy.run(Unknown Source) Caused by: Assertion failed: postToSlack. Values: postToSlack = null
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jawad,
When using the slack example can you please confirm you have created a Slack API token as mentioned in the documentation and referenced this in the header for the postToSlack rest API call as this will be required to access the Slack API's.
Also can you confirm that you have configured valid values in the channelName, userName and issueKey variables.
The examples, in the documentation have been fully tested and we can confirm these work if you configure the script as mentioned in the documentation page.
Regards,
Kristian
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.