Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I want to create custom form plugin with some input fields and on form submit event i want to call a Restful Web Service.

Vinay Panwar July 14, 2013

I want to create custom form plugin with some input fields and on form submit event i want to call a Restful Web Service. I want to know to solve the above purpose we need JIRA Source Code or it can be done by another technique. Please suggest me a best approach to do this.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
RambanamP
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.
July 15, 2013

Hey, exactly what do you want to do on jira from your WBRT application?

check the following rest client which is used to create issue issue on jira using REST

package com.rest.client;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;

public class RESTclient {

	public static void main(String[] args) {
		try {

			Client client = Client.create();			
			client.addFilter(new HTTPBasicAuthFilter("username", "password"));
			WebResource webResource = client.resource("http://<URL>/rest/api/2/issue");			
			String input="{\"fields\":{\"project\":{\"key\":\"JIRA\"},\"summary\":\"Test Ticket\",\"description\":\"This is a test CR\", \"reporter\": {\"name\": \"prasad\"},\"issuetype\":{\"name\":\"Defect\"},\"versions\":[{\"name\":\"1.1\"}],\"customfield_10692\":{\"value\":\"Stability\"},\"customfield_10430\":{\"value\":\"Stability\"},\"customfield_10005\":{\"value\":\"Blocker\"},\"components\":[{\"name\":\"test\"}]}}";		
			ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
	
			String output = response.getEntity(String.class);

			System.out.println("Output from Server .... \n");
			System.out.println(output);

		} catch (Exception e) {

			e.printStackTrace();

		}

	}
}

Vinay Panwar July 16, 2013

Hi All,

i want to send some input to WBRT(PHP app.) and get some response from it.

Thanks,

Vinay

RambanamP
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.
July 16, 2013

do you want to send some infromation from jira to WBRT application and get some data?

or

do you want to send some infromation from WBRT to jira and get some data?

0 votes
Dipti Ranjan Behera
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.
July 14, 2013

Hi Vinay,

No need of changing the JiRA source code , a simple restful webservice service plugin can achieve this functionality. Through rest API , send the input details through JSON or XML.

Dipti Ranjan Behera
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.
July 15, 2013

@Vinay,

Did my solution helped you , if yes please accept the answer.

But if you found a better solution , then please share with me :)

Vinay Panwar July 15, 2013

Hi Dipti,

I want to interact JIRA with WBRT(PHP Web Application) through Restful Web Service plugin, Is it possible.

Please provide me a sample code for it if possible.

RambanamP
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.
July 15, 2013

what operation you are trying to on jira from WBRT application?

Dipti Ranjan Behera
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.
July 15, 2013

@Vinay,

This is a sample rest webservice code :https://bitbucket.org/atlassian_tutorial/refapp-rest-service-plugin/src

TAGS
AUG Leaders

Atlassian Community Events