Forums

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

How fetch External REST web Services in JIRA Plugin Development

Niket March 25, 2018

Hi,

We have tried to create own plugin in JIRA using JIRA SDK whereas we able to create Plugin but there is the main purpose to create fetch the external web services from that plugin which we have not able to understand how do that?

If anyone has any solution to create the plugin for fetch external rest web services. 

1 answer

1 accepted

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 Leaders.
March 25, 2018

You can use Jersey client. You should add this dependency:

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.8-atlassian-15</version>
<scope>provided</scope>
</dependency>

Niket March 26, 2018

Thank you Alexey! I have used this dependency in pom.xml file but which module is used in atlassian-plugin.xml to fetch web services.

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 Leaders.
March 26, 2018

You need to define where you want to call the Rest Service and create this module. Maybe, you call it from a post function or validator. But anyway it is better to make your rest call service as a service in Jira (Named annotation)

Niket March 26, 2018

Hey alexey, beacuase of I am new in JIRA plugin not able to understand what you want to says. only I able to understand that I need to define that REST server where i want to call but what is create this module? I must be create the new module for this. I was only follows simple basic steps for Hello World Dev Program. which given by Atlassian team online document but still not able to find out the cosume webserivces from plugins. 
Can you also explain what is the Post function or validator.  also, you have says make rest call service as services in jira. (still not able to understand for me) I have already one dedicated jira server with me i want to cosume getproject api from this plugin. so why i create rest call services a services in jira?

 

Any another way?

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 Leaders.
March 26, 2018

You should try Jira plugin tutorials first and you should understand, what modules you can create in Jira. There is no such module as call an external service. Did you develop any program before (not a Jira plugin)? How would you call an external service from there? You would do the same way in a Jira plugin.

Module are entrances for your code in Jira. You asked, what a validator is. You can find more info here:

https://confluence.atlassian.com/adminjiracloud/advanced-workflow-configuration-776636620.html

Out of the box you can use built in validators, conditions and post functions. But, for example, you want to call an external rest from a post funciton. that is why you need to write your own post function and call a rest service from there. There is the module for the post function. Modules are entry points to Jira not out of Jira.

Niket March 27, 2018

Thank Alexey, I understood much better now.

But, if want to consume external web services {not a JIRA API web services} consider as another tool which they have there own rest API web services. So, what can be used here?

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 Leaders.
March 27, 2018

You can use the library, which I gave you. This library is for querying Rest Services. It does not matter, if the services are in Jira or not.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events