Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to check get content of web service using script runner

post data.png

1 answer

Thank You now I am getting content.

How I can check my data is sent or not using web service?

What do you mean? You sent data from Jira right? You can log it in. Then you have the web service, which receives your data. You should check if your data has been sent or not in the log of this web service.

I am doing  integration bet Jira and Polarion using web service.

I am using below code but I am not able to update jira id in polarion.

import groovy.json.JsonSlurper;
import groovy.json.StreamingJsonBuilder;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.ModifiedValue;
import com.atlassian.jira.issue.MutableIssue
import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger
import org.apache.commons.codec.binary.Base64;
import com.atlassian.jira.plugin.webfragment.model.JiraHelper;
import groovy.json.JsonBuilder
import java.util.Scanner;

def myLog = Logger.getLogger("com.onresolve.jira.groovy")"Hello kunti from Jira")

def user = "admin";
def password = "admin";
def issueID = "APS-425";
def issueStatus = "";
def getModifiedFields = "";
def uname = "admin";
def pwd = "admin";

//IssueManager issueManager = ComponentManager.getInstance().getIssueManager();
// //MutableIssue Issue = issueManager.getIssueObject("DEMO-467");
//MutableIssue Issue = issue;

//issueID = Issue.getKey();

//issueStatus = Issue.getStatus()
//getModifiedFields =Issue.getAssignee() ("issueID== " + issueID)
// ("issueStatus== " + ComponentAccessor.getIssueManager().getIssueObject(issue.getKey()).getStatus())
// ("getAssignee== " + getModifiedFields)
//def issueType =;
def textToTranslate = "";
def targetLanguage = "";
def originalLanguage ="";
def languagesCodes = [
Russian :"RU",
textToTranslate = "text to translate"
//targetLanguage = Issue.getCustomFieldValue(targetLanguageObject);

def body_req = [
"user": user,

def baseURL = "";
URL url;
url = new URL(baseURL);
String authStr = uname + ":" + pwd;
HttpURLConnection connection =(HttpURLConnection) url.openConnection();
connection.requestMethod = "POST"
connection.doOutput = true
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8")
connection.setRequestProperty("Accept", "application/ocsp-response");
connection.outputStream.withWriter("UTF-8") { new StreamingJsonBuilder(it, body_req) }
connection.connect();"url: " + url);"ResponseCode 1= "+ connection.getContent())

String data = "";
InputStream iStream =(InputStream) connection.getContent();
BufferedReader br = new BufferedReader(new InputStreamReader(iStream, "utf8"));
StringBuffer sb = new StringBuffer();
String line = "";

while ((line = br.readLine()) != null) {

data = sb.toString();
//"Data 1= "+ data)"ResponseCode 2= "+connection.getResponseCode())"ResponseCode 3= "+connection.getResponseMessage())
// JsonBuilder([abc: 42]).toString()).build())
catch(IOException e)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

214 views 7 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you