bobcarroll / jira-client Goto Github PK
View Code? Open in Web Editor NEWA simple JIRA REST client for Java
License: Other
A simple JIRA REST client for Java
License: Other
Hello! i was trying to just do a simple createIssue() call and received the following exception:
net.rcarz.jiraclient.JiraException: Project or issue type missing from create metadata
at net.rcarz.jiraclient.Issue.getCreateMetadata(Issue.java:467)
at net.rcarz.jiraclient.Issue.create(Issue.java:661)
at net.rcarz.jiraclient.JiraClient.createIssue(JiraClient.java:77)
My code is very simple, following along with your example:
JiraClient jira = new JiraClient(URL,CREDS);
Logger.info("Jira client: %s",jira.getSelf());
Issue issue = jira.createIssue(PROJECT, ISSUE_TYPE)
.field(Field.SUMMARY, summary)
.field(Field.DESCRIPTION, description + "\n\nreported by: " + reporter)
.field(Field.REPORTER, REPORTER)
.field(Field.LABELS, new String[] {schoolName, reporter})
.execute();
I'm using Jira OnDemand and i have confirmed that 'PROJECT" and 'ISSUE_TYPE' have values.
I'm not sure if this is a bug in my code, something i'm missing, or an environment problem (given that I'm on OnDemand).
thanks!
First of all : thank you for creating this awesome project !
I was trying out some things today, with our Jira install (v6.3.6a).
For example issue transistion; is it possible to get a list of available transitions for a given issue in a given state ?
For example :
for(Issue i : issues){
logger.debug(String.format("Jira back To Do: %s", i));
//Possible transitions ?
final Issue.FluentTransition transition = i.transition();
i.transition().execute("Stop Progress");
i.refresh();
}
TIA
Bart.
Now it's possible to create a subtask, but in my project the subtasks are not of issue type "Sub-task". So, I need a method to create a subtask with a given issue type name of the subtask. So, it will be more generic.
Here's my example for a solution:
public FluentCreate createSubtask(String subtaskIssueTypeName) throws JiraException {
return Issue.create(restclient, getProject().getKey(), subtaskIssueTypeName)
.field(Field.PARENT, getKey());
}
Is it possible to implement it fast?
THX Martin
When using the TokenCredentials initialized with username and password
TokenCredentials(String username, String password)
And then call the initialize function, the returned session id is not stored back to the token variable. So everytime the initialize have to be called before use any function. Token can be retrieved with
public void initialize(RestClient client) throws JiraException {
if (token==null) {
try {
JSONObject req = new JSONObject();
req.put("username", username);
req.put("password", password);
JSON json = client.post(Resource.getAuthUri() + "session", req);
JSONObject obj = (JSONObject)JSONSerializer.toJSON(json);
JSONObject session = obj.getJSONObject("session");
token = session.get("value").toString();
System.out.println(json.toString());
} catch (Exception ex) {
throw new JiraException("Failed to login", ex);
}
}
}
Hi ,
The below is my code for creating the JIRA ticket but its giving the below exception
public void createIssue() {
// String Jira_PayPal_URL = "https://jira.paypal.com/jira/";
//https://jira.paypal.com/jira/rest/api/2/issue/createmeta
String Jira_PayPal_URL ="https://jira.paypal.com/jira/rest/api/2";
BasicCredentials creds = new BasicCredentials("mselvansr", "password");
JiraClient jira = new JiraClient(Jira_PayPal_URL, creds);
Issue newIssue = null;
try {
newIssue = jira.createIssue("ECI", "Bug")
.field(Field.SUMMARY, "Automation ECI")
.field(Field.DESCRIPTION, "Automation On ECI - Demo")
.field(Field.REPORTER, "mselvansr")
.field(Field.ASSIGNEE, "mselvansr")
.execute();
} catch (JiraException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(newIssue);
}
Exception :
null
net.rcarz.jiraclient.JiraException: Failed to retrieve issue metadata
at net.rcarz.jiraclient.Issue.getCreateMetadata(Issue.java:457)
at net.rcarz.jiraclient.Issue.create(Issue.java:670)
at net.rcarz.jiraclient.JiraClient.createIssue(JiraClient.java:77)
at com.paypal.test.trd.utils.ECIPulse.createIssue(ECIPulse.java:62)
at com.paypal.test.trd.utils.ECIPulse.main(ECIPulse.java:42)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at net.rcarz.jiraclient.RestClient.request(RestClient.java:126)
at net.rcarz.jiraclient.RestClient.get(RestClient.java:243)
at net.rcarz.jiraclient.Issue.getCreateMetadata(Issue.java:455)
... 4 more
Looking at src/main/java/net/rcarz/jiraclient/greenhopper/Sprint.java#deserialise
I think this line:
closed = Field.getBoolean(map.get("closed"));
should be something like:
closed = "CLOSED".equalsIgnoreCase(Field.getString(map.get("state")));
I would have been happy to push a bug branch for a pull request, but it's not allowed. What is the procedure for supplying fixes to GitHub projects?
BTW. Very useful project, cheers.
Please add an option to skip the https cert validation. Right now if you have a self signed cert for your jira running you get a "peer not authenticated" message. Adding that cert to the java cert key store is not an option. There should be an easy flag to skip cert validation.
Currently i get error messages like:
Exception in thread "main" java.lang.UnsupportedOperationException: timetracking is not a supported field type
at net.rcarz.jiraclient.Field.toJson(Field.java:570)
at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:171)
at Main.main(Main.java:41)
My Code:
Issue.SearchResult sr = jira.searchIssues("project = "xyz" and fixVersion in releasedVersions() and status not in (Resolved, Closed)");
for (Issue i : sr.issues)
{
List tmpfixversions = i.getFixVersions();
for (Version tmpVersion : tmpfixversions) {
if (!(tmpVersion.toString().equals("xxx")|| tmpVersion.toString().equals("yyy")))
{
i.update()
.fieldRemove(Field.FIX_VERSIONS,tmpVersion.getName())
.execute();
System.out.println(i.getKey().toString() + tmpVersion.toString());
}
}
}
Exception:
net.rcarz.jiraclient.JiraException: Failed to update issue xxxx-6028
at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:191)
at Main.main(Main.java:31)
Caused by: net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":["Field with id' fixVersions' and name 'Fix Version/s' does not support operation 'name' Supported operation(s) are: 'set,add,remove'"],"errors":{}}
at net.rcarz.jiraclient.RestClient.request(RestClient.java:138)
at net.rcarz.jiraclient.RestClient.request(RestClient.java:160)
at net.rcarz.jiraclient.RestClient.request(RestClient.java:178)
at net.rcarz.jiraclient.RestClient.put(RestClient.java:341)
at net.rcarz.jiraclient.RestClient.put(RestClient.java:359)
at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:189)
... 1 more
Hi,
I am trying to integrate JIRA. PFB my code.
import net.rcarz.jiraclient.BasicCredentials;
import net.rcarz.jiraclient.Issue;
import net.rcarz.jiraclient.JiraClient;
import net.rcarz.jiraclient.JiraException;
public class Jira {
public static void main(String[] args) {
BasicCredentials creds = new BasicCredentials(UserName, Pwd);
JiraClient jira = new JiraClient("URL", creds);
try {
Issue issue = jira.getIssue("AWEB-2173");
System.out.println(issue);
} catch (JiraException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
i am getting the below exception.
net.rcarz.jiraclient.JiraException: Failed to retrieve issue AWEB-2173
at net.rcarz.jiraclient.Issue.realGet(Issue.java:700)
at net.rcarz.jiraclient.Issue.get(Issue.java:723)
at net.rcarz.jiraclient.JiraClient.getIssue(JiraClient.java:90)
at Jira.main(Jira.java:15)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:431)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at net.rcarz.jiraclient.RestClient.request(RestClient.java:126)
at net.rcarz.jiraclient.RestClient.get(RestClient.java:243)
at net.rcarz.jiraclient.Issue.realGet(Issue.java:698)
... 3 more
Could you please help me to resolve this
Implement downloading attachment data as raw bytes.
Priorities, components, version, etc.
Hello,
I am running a web application on my tomcat and I really like your library which is why i am currently using it. However my application will be used by multiple users, so I can't just hardcode the username and password inside it. On the other hand I don't want to ask the user for their credentials on the client-side since it would be very insecure to transport that information from the client to the server side.
So what is the right approach to authenticate to jira with this library with multiple Users ?
I saw, that the Jira Rest API has the possibility to submit the credentials bas64 encoded. Can I use this feature with this library ?
Thanks in advance
I've created a patch that contains:
However, I don't seem to figure out how to use git :) I've checked out the jira client using subversion :) Is there a way to submit a patch (like, I've got the stuff that goes into patch -p0...)
The hh:mm:ss part of the Date is not preserved while deserializing ChangeLogEntry. For some issues the time of first edit seems before it's creation, where the timestamp is complete.
v.0.5
getAttachments returns empty for non empty attachments. If you run the following snippet:
val creds = new BasicCredentials("myuser", "x");
val client = new JiraClient("https://issues.apache.org/jira", creds);
val issueResult =
client.
// searchIssues("project=BIGTOP AND status=CLOSED AND updated > -2220h");
searchIssues("project=BIGTOP AND status=CLOSED AND attachments IS NOT EMPTY");
println(issueResult.total);
println(issueResult.issues.size());
(0 to issueResult.issues.size()-1).
foreach((i:Int) =>
println(i + " attachements: " +
issueResult.issues.get(i).getKey()+" "+
issueResult.issues.get(i).get().size()))
issueResult.
issues.
foreach((i: Issue) =>
i.getAttachments().
foreach(
(a: Attachment) =>
println(i + " DATE : "+ a.getCreatedDate())));
println("DONE");
The result is a bunch of JIRA's which clearly have attachments, but accessing them via API yields an attachments list of size "0" :
0 attachements: BIGTOP-1181 0
1 attachements: BIGTOP-1180 0
2 attachements: BIGTOP-1168 0
3 attachements: BIGTOP-1156 0
4 attachements: BIGTOP-1147 0
JIRA docs say there is a way to do bulk updates via REST API.
I want to reopen 100+ issues using this library without triggering mass-email for every issue. you can disable sending mail in JIRA UI when you do bulk updates, so may be there is a way to do the same via REST?
At the moment they are of compile scope, should be test
I'm speculating about the exact cause, but here's a description of some behaviour. I've not use REST or JSON before, so I'm very likely to get terminology wrong. Please bear with me.
When calling
JiraClient.createIssue("Project", "IssueType").field("foo", "bar").execute()
against my Jira server, for certain projects I get an exception (paraphrasing)
"field issuetype missing or read only"
For our Jira installation, the thing in common for the projects where the exception occurs is that they have only one issue type associated with them.
Some exploration shows that the Jira server makes a response to a call in
Field.getCreateMetadata()
the returned JSON object differs between the two types of project. In ones with multiple issue types, the returned JSON contains an entry
root/Projects[0]/IssueTypes[0]/fields/issuetype
but in projects with only one issue type, there's no corresponding field.
This means that when Issue.executeCreate() get's called, around line 103, it looks for the issue type field, and fails to find it.
My workaround (which seems to work, but which I'm sure is about as inelegant as possible) is to replace that loop starting at line 103
for (Map.Entry<String, Object> ent : fields.entrySet()) {
Object newval = null;
try
{
newval = Field.toJson(ent.getKey(), ent.getValue(), createmeta);
}
catch (Exception e)
{
newval = "{\"name\":\"" + ent.getValue() + "\"}";
}
fieldmap.put(ent.getKey(), newval);
}
(I'm not suggesting that this is the right fix, but it might help you work out what's going on).
Anyway, many thanks for a great library. I'm a refugee from the one that Atlassian provides, and yours is a heap easier to work with.
e.g. a field can be shown as "MyField" in JIRA UI, but actual custom field name returned by JSON is something like "customfield_15123".
issue.getField() method in rcarz' library expects this ID, not visible name.
how can I retrieve those IDs? there does not seem to be any API for this.. I expected to see something in Project class.
here is the URL for retrieving custom field definitions that can be then used to resolve name->Ids
JIRA_URL/rest/api/2/field
Hi,
I'm new to Jira REST api and i was trying jira client, but I'm getting an error message
"peer not authenticated" in method jira.getIssue(...).
I have jira-client 0.3 and I'm using it with Jira 5.2, Is this client compatible with this Jira version?
I suspect that the problem should be related with the type of authentication that is made.
Snippet of code used:
BasicCredentials creds = new BasicCredentials("user", "pass");
JiraClient jira = new JiraClient("https://jira.somewhere.com", creds);
try {
Issue issue = jira.getIssue("AAAA-1");
Considering the use of
DefaultHttpClient httpclient = new DefaultHttpClient();
in line 62 of JiraClient.java, it seems there is a default infinite read timeout. I've run in to this situation myself, where a thread making use of the jira-client will hang indefinitely. I can't shut this down in a nice way:
Thread.interrupt()
doesn't seem to abort the request. There seems to be only the possibility to set the timeout beforehand, when constructing the httpclient, or to do the request in a separate thread and call an abort on it (basically doing the timeout logic oneself).
Therefor my bug report: can you please construct the httpclient with a default read timeout?
And a feature request, to be able to set the read timeout via an additional JiraClient-constructor.
net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"assignee":"data was not an object"}}
source code
BasicCredentials creds = new BasicCredentials(site.userName, site.password);
JiraClient jira = new JiraClient(site.url.toString(), creds);
final Issue tempIssue = jira.getIssue(issue.id);
logger.println ("It will update the below jira " + tempIssue.getUrl());
logger.println (" + assignee " + assignee);
tempIssue.addComment("No problem. We'll get right on it!");
tempIssue.update().field(Field.ASSIGNEE, "user1").execute();
Updating TEST-1
It will update the below jira http://192.168.59.103:8080/rest/api/latest/issue/10000
+ assignee vmartinez
Looks like TEST-1 is no valid JIRA issue or you don't have permission to update the issue.
Issue will not be updated.
net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"assignee":"data was not an object"}}
Finished: SUCCESS
any ideas? Am I using the right format in order to assign a new user?
I am using version 0.5 from Maven Central.
the README file has example how to load and print out custom multi-select fields, but nothing about changing values in them.
I can't create an instance of CustomFieldOption.
maybe it makes sense to add API for that - or at least document some workaround? e.g. loading existing values from server and updating them.
every time I try creating a JIRA issue with a multi-select value, I get
Caused by: net.rcarz.jiraclient.RestException: 400 Bad Request:
{"errorMessages":[],"errors":{"Environments Affected":"expected Object"}}
and same when trying to update an existing issue.
my custom field is an array of strings:
{
"id": "customfield_15120",
"name": "Environments Affected",
"custom": true,
"orderable": true,
"navigable": true,
"searchable": true,
"schema": {
"type": "array",
"items": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:multiselect",
"customId": 15120
}
},
I had to implement my own custom code to set multi-select custom fields:
private void updateIssueMultiSelectField(String issueKey, String fieldId, String value) {
final UriBuilder uriBuilder = UriBuilder.fromUri(jiraUri);
uriBuilder.path("/rest/api/2/issue").path(issueKey);
final WebResource webResource = client.resource(uriBuilder.build());
String jsonArrayValue = " [ {\"value\": \"" + value + "\" }]";
final String json = "{ \"update\": { \"" + fieldId + "\": [ {\"set\": " + jsonArrayValue + "}] } }";
final ClientResponse response = webResource.accept("application/json")
.type("application/json").put(ClientResponse.class, json);
if (response.getStatus() >= 300) {
final String entity = response.getEntity(String.class);
final String errorMessage = "Error when updating field: " + entity;
throw new RuntimeException(errorMessage);
}
}
Currently issue.getChangeLog seems always to return null. I believe one should specify "expand" attribute when performing issue query and wanting to get changelog back. Currently I do not see such possibility.
Updating issue fields based on their name seems to be nice but only on first sight. When dealing for example with different locales it's impossible to update a value based on the name.
Would be awesome if you could extend the Issue.FluentCreate
class by adding a method like fieldById(fieldId, valueId)
. For custom fields with multiple possible values the value has to be updated by id. And there should be also field updates based on the field id with raw content (for text fields).
Thanks a for creating this awesome client which is much easier to use compared to the original JRJC!
Hi,
I am trying to create new project (I am not using maven, just downloaded and imported the project in eclipse), I am getting compilation error in many files ๐
private void deserialise(JSONObject json) {
Map map = json;
......
This definitely is a legitimate compilation error. I am not sure how this project is evne build with this line in place.
Even the source file present in github has this line.
Please let me know if this issue is a known issue or I am missing something.
Hi,
null checks need adding to the TimeTracker toJsonObject method to void a null pointer when creating TimeTracking on a new Jira.
Jira in Legacy mode does not allow both Original and Remaining estimates to be set at the same time but the TimeTracking class requires both.
The work around is to set either original or remaining estimate as -1.
TimeTracking estimate = new TimeTracking();
estimate.setOrignalEstimateSeconds(7200);
estimate.setRemainingEstimateSeconds(-1);
code:
final Object field = issue.getField(lastUpdatedOnFieldId);
the issue in question was created in JIRA before this custom field was created, so this issue does not have any value set in this field.
javadoc for issue.getField() says that it will return null if field is not found, but in fact it returns an instance of net.sf.json.JSONNull.
also, I suggest using Java 8 Optional<> instead of nulls for much better readability and stability in client code.
Is there a way to iterate through custom fields for an issue?
The internal Jira API has this:
CustomField customField : issue.getProjectObject().getgetCustomFieldObjects(issue))
Is there something similar I could use?
(I'm also happy to contribute to the coding if not)
In order to make calls to JIRA on behalf of users, support for using an OAuth access token would be great.
There's sample code for the actual OAuth dance:
https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-oauth-authentication
I got following code snippet
workUpdate = workUpdate.field(Field.PRIORITY, "Blocker");
but that generates a server error
2014-05-26 16:45:25,189 http-bio-8080-exec-4 ERROR bede 1005x1245x1 oxbx4f 10.7.30.251 /rest/api/2/issue/TSTC-6 [jira.rest.exception.ExceptionInterceptor] Returning internal server error in response
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Tried it with the Field.valueById (like in the example - same effect)
Code for testing:
for (Project project_temp : projects) {
System.out.println(project_temp.getId());
if(project_temp.getLead() == null)
System.out.println("No lead");
else
System.out.println(project_temp.getLead().getEmail());
index++;
}
Result:
10800
No lead
11202
No lead
However, I checked with Jira, there are Leads for each project.
Hi,
I wrote a simple app which uses this library for some git post-commit actions.. being able to update JIRA automatically from git check-in comments.
But, when I went to bundle everything together, I notice the total size of dependencies is huge (~5 Meg). I see libraries such as "mockito-all-1.9.0.jar" which are 1.4 Meg and many others.
I noticed your latest check-in reduces some of these dependancies. Can you push that version to the Maven repo?
I figured I could just embed your library bypassing the maven repo but don't know enough yet about Maven or Java build configuration to figure out a better way..
Here's all of the libraries maven seems to think is required. The only dependency in my pom.xml is yours:
<dependency>
<groupId>net.rcarz</groupId>
<artifactId>jira-client</artifactId>
<version>0.5</version>
</dependency>
commons-beanutils-1.8.0.jar
commons-codec-1.6.jar
commons-collections-3.2.1.jar
commons-httpclient-3.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
ezmorph-1.0.6.jar
httpclient-4.2.5.jar
httpcore-4.2.4.jar
httpmime-4.2.5.jar
jira-client-0.5.jar
joda-time-2.3.jar
json-lib-2.4-jdk15.jar
junit-4.8.2.jar
mockito-all-1.9.0.jar
Hi,
I've made a private version of jira client where the maxResults jql parameter can be defined to a value different from 50 (default).
Can this change be considered in a future release?
Thanks in advance
Roberto
Hi, you have done good work. But I faced with one problem.
Your code hasn't ability to specify resource uri, it's hardcoded as constant
protected static final String RESOURCE_URI = "/rest/api/2/";
but resource URI for me is rest/api/2.0.alpha1
I don't want to do any workaround with reflection or something else, I want to keep own code simple and clear.
Thanks.
I can create bug using following code
Issue newIssue = jira.createIssue("TEST", "Bug")
.field(Field.SUMMARY, "Bat signal is broken")
.field(Field.DESCRIPTION, "Commissioner Gordon reports the Bat signal is broken.")
.field(Field.REPORTER, "batman")
.field(Field.ASSIGNEE, "robin")
.execute();
How do I make sure that above is created in a specific project ? where do I specify the project ?
Thanks,
Nikesh
I couldn't work out how to "blank out" a Jira field through your API. This might be totally wrong, but in the method Field.toJson() there is a check for value being null.
....
if (value == null)
return null;
....
I changed it to
if (value == null)
return JSONNull.getInstance();
which then allows Jira fields to be set to empty.
I had a look to find an existing way to do it, but could't. If I've got the wrong end of the stick, my apologies.
Hi, first of all thanks for creating this awesome tool!
In Jira I have a custom field that is of type Checkboxes with id = customfield_10023. The only option is "Yes" which has an id of 10013. I thought that doing what you did in the README.md file, for multi-select boxes, would work, but I can't seem to get it to. Is it not supported or is there a different way to set check boxes? Thank you very much.
// Tried using the id
symptom.update().field("customfield_10023", new ArrayList() {{
add(Field.valueById("10013"));
}})
.execute();
// Also tried using the value
symptom.update().field("customfield_10023", new ArrayList() {{
add("Yes");
}})
.execute();
Both ways I get the following error:
Error during Jira Symptom creation: net.rcarz.jiraclient.JiraException: Failed to update issue TEST-1056
net.rcarz.jiraclient.JiraException: Failed to update issue TEST-1056
at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:191)
at devopsdatamigrator.JiraHandle.createSymptom(JiraHandle.java:150)
at devopsdatamigrator.DataMigrator.migrateIssues(DataMigrator.java:208)
at devopsdatamigrator.DataMigrator.migrateObjects(DataMigrator.java:70)
at devopsdatamigrator.DataMigrator.main(DataMigrator.java:252)
Caused by: net.rcarz.jiraclient.RestException: 400 Bad Request: {"errorMessages":[],"errors":{"Customer Data Unavailable Flag":"expected Object"}}
at net.rcarz.jiraclient.RestClient.request(RestClient.java:160)
at net.rcarz.jiraclient.RestClient.request(RestClient.java:182)
at net.rcarz.jiraclient.RestClient.request(RestClient.java:200)
at net.rcarz.jiraclient.RestClient.put(RestClient.java:380)
at net.rcarz.jiraclient.RestClient.put(RestClient.java:398)
at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:189)
Ok, this may seem like a silly question (or out of scope of this project) but... I'm trying to use jira-client to update a field (like Comment) and immediately show it in the browser.
I assumed I didn't have to do manual page refresh ?
Sample code:
...
//Add comment to issue - THIS WORKS BUT NEEDS REFRESH
issue.addComment("my comment");
//Following line throws error : Field expects an Iterable value
issue.update().field(Field.COMMENT, "my comment").execute();
...
What do I need to get the updated fields visible in browser ?
TIA
Bart
The method
private JSON request(HttpRequestBase req) {}
read the content from HttpEntity with an InputStreamReader without specifing the content charset. In this case the InputStreamReader uses the default plattform encoding. This encoding might not match the content encoding (in my case content charset is utf-8, plattform encoding is cp1252).
The InputStreamReader should be created with
new InputStreamReader(ent.getContent(), ent.getContentEncoding().getValue()));
if ent.getContentEncoding() is not null.
The content encoding can be changed like this:
DefaultHttpClient client = (DefaultHttpClient) jira.getRestClient().getHttpClient();
HttpParams params = client.getParams();
HttpProtocolParams.setContentCharset(params, "utf-8");
HttpProtocolParams.setHttpElementCharset(params, "utf-8");
Thanks!
I tried creating a defect using createIssue() method
I'm getting Unauthorized 401 error. I have used the Jira attlasian demo account that can be accessed freely at https://jira.atlassian.com
My credentials Im passing to JiraClient are
URL "https://jira.atlassian.com"
Project "TST"
Username "[email protected]"
Password "[email protected]"
net.rcarz.jiraclient.JiraException: Failed to retrieve issue metadata
at net.rcarz.jiraclient.Issue.getCreateMetadata(Issue.java:457)
at net.rcarz.jiraclient.Issue.create(Issue.java:670)
at net.rcarz.jiraclient.JiraClient.createIssue(JiraClient.java:77)
at com.backbone.server.utils.JiraUtils.createIssue(JiraUtils.java:25)
at com.backbone.server.service.TestService.testAnything(TestService.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.backbone.server.filter.LogFilter.doFilter(LogFilter.java:32)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.backbone.server.filter.AuthFilter.doFilter(AuthFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: net.rcarz.jiraclient.RestException: 401 Unauthorized: <title>Unauthorized (401)</title> <script type="text/javascript">(window.NREUM||(NREUM={})).loader_config={xpid:"XQEHVUVSDgIAVVlR"};window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[function(t,e){function n(t){function e(e,n,a){t&&t(e,n,a),a||(a={});for(var c=s(e),u=c.length,f=i(a,o,r),d=0;u>d;d++)c[d].apply(f,n);return f}function a(t,e){u[t]=s(t).concat(e)}function s(t){return u[t]||[]}function c(){return n(e)}var u={};return{on:a,emit:e,create:c,listeners:s,_events:u}}function r(){return{}}var o="nr@context",i=t("gos");e.exports=n()},{gos:"7eSDFh"}],ee:[function(t,e){e.exports=t("QJf3ax")},{}],3:[function(t){function e(t,e,n,i,s){try{c?c-=1:r("err",[s||new UncaughtException(t,e,n)])}catch(u){try{r("ierr",[u,(new Date).getTime(),!0])}catch(f){}}return"function"==typeof a?a.apply(this,o(arguments)):!1}function UncaughtException(t,e,n){this.message=t||"Uncaught error with no additional information",this.sourceURL=e,this.line=n}function n(t){r("err",[t,(new Date).getTime()])}var r=t("handle"),o=t(4),i=t("ee"),a=window.onerror,s=!1,c=0;t("loader").features.err=!0,window.onerror=e,NREUM.noticeError=n;try{throw new Error}catch(u){"stack"in u&&(t(5),t(3),"addEventListener"in window&&t(1),window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&t(2),s=!0)}i.on("fn-start",function(){s&&(c+=1)}),i.on("fn-err",function(t,e,r){s&&(this.thrown=!0,n(r))}),i.on("fn-end",function(){s&&!this.thrown&&c>0&&(c-=1)}),i.on("internal-error",function(t){r("ierr",[t,(new Date).getTime(),!0])})},{1:4,2:7,3:5,4:18,5:6,ee:"QJf3ax",handle:"D5DuLP",loader:"G9z0Bl"}],4:[function(t,e){function n(t){i.inPlace(t,["addEventListener","removeEventListener"],"-",r)}function r(t){return t[1]}var o=(t(1),t("ee").create()),i=t(2)(o),a=t("gos");if(e.exports=o,n(window),"getPrototypeOf"in Object){for(var s=document;s&&!s.hasOwnProperty("addEventListener");)s=Object.getPrototypeOf(s);s&&n(s);for(var c=XMLHttpRequest.prototype;c&&!c.hasOwnProperty("addEventListener");)c=Object.getPrototypeOf(c);c&&n(c)}else XMLHttpRequest.prototype.hasOwnProperty("addEventListener")&&n(XMLHttpRequest.prototype);o.on("addEventListener-start",function(t){if(t[1]){var e=t[1];"function"==typeof e?this.wrapped=t[1]=a(e,"nr@wrapped",function(){return i(e,"fn-",null,e.name||"anonymous")}):"function"==typeof e.handleEvent&&i.inPlace(e,["handleEvent"],"fn-")}}),o.on("removeEventListener-start",function(t){var e=this.wrapped;e&&(t[1]=e)})},{1:18,2:19,ee:"QJf3ax",gos:"7eSDFh"}],5:[function(t,e){var n=(t(2),t("ee").create()),r=t(1)(n);e.exports=n,r.inPlace(window,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame"],"raf-"),n.on("raf-start",function(t){t[0]=r(t[0],"fn-")})},{1:19,2:18,ee:"QJf3ax"}],6:[function(t,e){function n(t,e,n){var r=t[0];"string"==typeof r&&(r=new Function(r)),t[0]=o(r,"fn-",null,n)}var r=(t(2),t("ee").create()),o=t(1)(r);e.exports=r,o.inPlace(window,["setTimeout","setInterval","setImmediate"],"setTimer-"),r.on("setTimer-start",n)},{1:19,2:18,ee:"QJf3ax"}],7:[function(t,e){function n(){c.inPlace(this,d,"fn-")}function r(t,e){c.inPlace(e,["onreadystatechange"],"fn-")}function o(t,e){return e}var i=t("ee").create(),a=t(1),s=t(2),c=s(i),u=s(a),f=window.XMLHttpRequest,d=["onload","onerror","onabort","onloadstart","onloadend","onprogress","ontimeout"];e.exports=i,window.XMLHttpRequest=function(t){var e=new f(t);try{i.emit("new-xhr",[],e),u.inPlace(e,["addEventListener","removeEventListener"],"-",function(t,e){return e}),e.addEventListener("readystatechange",n,!1)}catch(r){try{i.emit("internal-error",[r])}catch(o){}}return e},window.XMLHttpRequest.prototype=f.prototype,c.inPlace(XMLHttpRequest.prototype,["open","send"],"-xhr-",o),i.on("send-xhr-start",r),i.on("open-xhr-start",r)},{1:4,2:19,ee:"QJf3ax"}],8:[function(t){function e(t){if("string"==typeof t&&t.length)return t.length;if("object"!=typeof t)return void 0;if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&t.byteLength)return t.byteLength;if("undefined"!=typeof Blob&&t instanceof Blob&&t.size)return t.size;if("undefined"!=typeof FormData&&t instanceof FormData)return void 0;try{return JSON.stringify(t).length}catch(e){return void 0}}function n(t){var n=this.params,r=this.metrics;if(!this.ended){this.ended=!0;for(var i=0;c>i;i++)t.removeEventListener(s[i],this.listener,!1);if(!n.aborted){if(r.duration=(new Date).getTime()-this.startTime,4===t.readyState){n.status=t.status;var a=t.responseType,u="arraybuffer"===a||"blob"===a||"json"===a?t.response:t.responseText,f=e(u);if(f&&(r.rxSize=f),this.sameOrigin){var d=t.getResponseHeader("X-NewRelic-App-Data");d&&(n.cat=d.split(", ").pop())}}else n.status=0;r.cbTime=this.cbTime,o("xhr",[n,r,this.startTime])}}}function r(t,e){var n=i(e),r=t.params;r.host=n.hostname+":"+n.port,r.pathname=n.pathname,t.sameOrigin=n.sameOrigin}if(window.XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.addEventListener&&!/CriOS/.test(navigator.userAgent)){t("loader").features.xhr=!0;var o=t("handle"),i=t(2),a=t("ee"),s=["load","error","abort","timeout"],c=s.length,u=t(1);t(4),t(3),a.on("new-xhr",function(){this.totalCbs=0,this.called=0,this.cbTime=0,this.end=n,this.ended=!1,this.xhrGuids={}}),a.on("open-xhr-start",function(t){this.params={method:t[0]},r(this,t[1]),this.metrics={}}),a.on("open-xhr-end",function(t,e){"loader_config"in NREUM&&"xpid"in NREUM.loader_config&&this.sameOrigin&&e.setRequestHeader("X-NewRelic-ID",NREUM.loader_config.xpid)}),a.on("send-xhr-start",function(t,n){var r=this.metrics,o=t[0],i=this;if(r&&o){var u=e(o);u&&(r.txSize=u)}this.startTime=(new Date).getTime(),this.listener=function(t){try{"abort"===t.type&&(i.params.aborted=!0),("load"!==t.type||i.called===i.totalCbs&&(i.onloadCalled||"function"!=typeof n.onload))&&i.end(n)}catch(e){try{a.emit("internal-error",[e])}catch(r){}}};for(var f=0;c>f;f++)n.addEventListener(s[f],this.listener,!1)}),a.on("xhr-cb-time",function(t,e,n){this.cbTime+=t,e?this.onloadCalled=!0:this.called+=1,this.called!==this.totalCbs||!this.onloadCalled&&"function"==typeof n.onload||this.end(n)}),a.on("xhr-load-added",function(t,e){var n=""+u(t)+!!e;this.xhrGuids&&!this.xhrGuids[n]&&(this.xhrGuids[n]=!0,this.totalCbs+=1)}),a.on("xhr-load-removed",function(t,e){var n=""+u(t)+!!e;this.xhrGuids&&this.xhrGuids[n]&&(delete this.xhrGuids[n],this.totalCbs-=1)}),a.on("addEventListener-end",function(t,e){e instanceof XMLHttpRequest&&"load"===t[0]&&a.emit("xhr-load-added",[t[1],t[2]],e)}),a.on("removeEventListener-end",function(t,e){e instanceof XMLHttpRequest&&"load"===t[0]&&a.emit("xhr-load-removed",[t[1],t[2]],e)}),a.on("fn-start",function(t,e,n){e instanceof XMLHttpRequest&&("onload"===n&&(this.onload=!0),("load"===(t[0]&&t[0].type)||this.onload)&&(this.xhrCbStart=(new Date).getTime()))}),a.on("fn-end",function(t,e){this.xhrCbStart&&a.emit("xhr-cb-time",[(new Date).getTime()-this.xhrCbStart,this.onload,e],e)})}},{1:"XL7HBI",2:9,3:7,4:4,ee:"QJf3ax",handle:"D5DuLP",loader:"G9z0Bl"}],9:[function(t,e){e.exports=function(t){var e=document.createElement("a"),n=window.location,r={};e.href=t,r.port=e.port;var o=e.href.split("://");return!r.port&&o[1]&&(r.port=o[1].split("/")[0].split(":")[1]),r.port&&"0"!==r.port||(r.port="https"===o[0]?"443":"80"),r.hostname=e.hostname||n.hostname,r.pathname=e.pathname,"/"!==r.pathname.charAt(0)&&(r.pathname="/"+r.pathname),r.sameOrigin=!e.hostname||e.hostname===document.domain&&e.port===n.port&&e.protocol===n.protocol,r}},{}],gos:[function(t,e){e.exports=t("7eSDFh")},{}],"7eSDFh":[function(t,e){function n(t,e,n){if(r.call(t,e))return t[e];var o=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(t,e,{value:o,writable:!0,enumerable:!1}),o}catch(i){}return t[e]=o,o}var r=Object.prototype.hasOwnProperty;e.exports=n},{}],D5DuLP:[function(t,e){function n(t,e,n){return r.listeners(t).length?r.emit(t,e,n):(o[t]||(o[t]=[]),void o[t].push(e))}var r=t("ee").create(),o={};e.exports=n,n.ee=r,r.q=o},{ee:"QJf3ax"}],handle:[function(t,e){e.exports=t("D5DuLP")},{}],XL7HBI:[function(t,e){function n(t){var e=typeof t;return!t||"object"!==e&&"function"!==e?-1:t===window?0:i(t,o,function(){return r++})}var r=1,o="nr@id",i=t("gos");e.exports=n},{gos:"7eSDFh"}],id:[function(t,e){e.exports=t("XL7HBI")},{}],loader:[function(t,e){e.exports=t("G9z0Bl")},{}],G9z0Bl:[function(t,e){function n(){var t=p.info=NREUM.info;if(t&&t.agent&&t.licenseKey&&t.applicationID&&c&&c.body){p.proto="https"===d.split(":")[0]||t.sslForHttp?"https://":"http://",a("mark",["onload",i()]);var e=c.createElement("script");e.src=p.proto+t.agent,c.body.appendChild(e)}}function r(){"complete"===c.readyState&&o()}function o(){a("mark",["domContent",i()])}function i(){return(new Date).getTime()}var a=t("handle"),s=window,c=s.document,u="addEventListener",f="attachEvent",d=(""+location).split("?")[0],p=e.exports={offset:i(),origin:d,features:{}};c[u]?(cu,su):(cf,sf),a("mark",["firstbyte",i()])},{handle:"D5DuLP"}],18:[function(t,e){function n(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=Array(0>o?0:o);++r<o;)i[r]=t[e+r];return i}e.exports=n},{}],19:[function(t,e){function n(t){return!(t&&"function"==typeof t&&t.apply&&!t[i])}var r=t("ee"),o=t(1),i="nr@wrapper",a=Object.prototype.hasOwnProperty;e.exports=function(t){function e(t,e,r,a){function nrWrapper(){var n,i,s,u;try{i=this,n=o(arguments),s=r&&r(n,i)||{}}catch(d){f([d,"",[n,i,a],s])}c(e+"start",[n,i,a],s);try{return u=t.apply(i,n)}catch(p){throw c(e+"err",[n,i,p],s),p}finally{c(e+"end",[n,i,u],s)}}return n(t)?t:(e||(e=""),nrWrapper[i]=!0,u(t,nrWrapper),nrWrapper)}function s(t,r,o,i){o||(o="");var a,s,c,u="-"===o.charAt(0);for(c=0;c<r.length;c++)s=r[c],a=t[s],n(a)||(t[s]=e(a,u?s+o:o,i,s,t))}function c(e,n,r){try{t.emit(e,n,r)}catch(o){f([o,e,n,r])}}function u(t,e){if(Object.defineProperty&&Object.keys)try{var n=Object.keys(t);return n.forEach(function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){return t[n]=e,e}})}),e}catch(r){f([r])}for(var o in t)a.call(t,o)&&(e[o]=t[o]);return e}function f(e){try{t.emit("internal-error",e)}catch(n){}}return t||(t=r),e.inPlace=s,e.flag=i,e}},{1:18,ee:"QJf3ax"}]},{},["G9z0Bl",3,8]);</script><script type="text/javascript">var contextPath = '';</script><script>window.WRM=window.WRM||{};window.WRM._unparsedData=window.WRM._unparsedData||{};WRM._unparsedData["jira.webresources:dateFormatProvider.dateFormat"]="{"meridiem":["AM","PM"],"eras":["BC","AD"],"months":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthsShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"weekdaysShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"weekdays":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]}";WRM._unparsedData["com.atlassian.jira.plugins.jira-admin-helper-plugin:notification-event-provider.notification-event-data"]="[{"id":1,"name":"Issue Created","isDefault":true},{"id":2,"name":"Issue Updated"},{"id":3,"name":"Issue Assigned"},{"id":4,"name":"Issue Resolved"},{"id":5,"name":"Issue Closed"},{"id":6,"name":"Issue Commented"},{"id":14,"name":"Issue Comment Edited"},{"id":17,"name":"Issue Comment Deleted"},{"id":7,"name":"Issue Reopened"},{"id":8,"name":"Issue Deleted"},{"id":9,"name":"Issue Moved"},{"id":10,"name":"Work Logged On Issue"},{"id":11,"name":"Work Started On Issue"},{"id":12,"name":"Work Stopped On Issue"},{"id":15,"name":"Issue Worklog Updated"},{"id":16,"name":"Issue Worklog Deleted"},{"id":13,"name":"Generic Event"}]";WRM._unparsedData["com.atlassian.jira.plugins.jira-admin-helper-plugin:permissions-provider.permissions-data"]="[{"permissions":[{"name":"Administer Projects","id":"23"},{"name":"Browse Projects","id":"10"},{"name":"View Development Tools","id":"29"},{"name":"View Read-Only Workflow","id":"45"}],"name":"Project Permissions"},{"permissions":[{"name":"Create Issues","id":"11"},{"name":"Edit Issues","id":"12"},{"name":"Transition Issues","id":"46"},{"name":"Schedule Issues","id":"28"},{"name":"Move Issues","id":"25"},{"name":"Assign Issues","id":"13"},{"name":"Assignable User","id":"17"},{"name":"Resolve Issues","id":"14"},{"name":"Close Issues","id":"18"},{"name":"Modify Reporter","id":"30"},{"name":"Delete Issues","id":"16"},{"name":"Link Issues","id":"21"},{"name":"Set Issue Security","id":"26"}],"name":"Issue Permissions"},{"permissions":[{"name":"View Voters and Watchers","id":"31"},{"name":"Manage Watchers","id":"32"}],"name":"Voters & Watchers Permissions"},{"permissions":[{"name":"Add Comments","id":"15"},{"name":"Edit All Comments","id":"34"},{"name":"Edit Own Comments","id":"35"},{"name":"Delete All Comments","id":"36"},{"name":"Delete Own Comments","id":"37"}],"name":"Comments Permissions"},{"permissions":[{"name":"Create Attachments","id":"19"},{"name":"Delete All Attachments","id":"38"},{"name":"Delete Own Attachments","id":"39"}],"name":"Attachments Permissions"},{"permissions":[{"name":"Work On Issues","id":"20"},{"name":"Edit Own Worklogs","id":"40"},{"name":"Edit All Worklogs","id":"41"},{"name":"Delete Own Worklogs","id":"42"},{"name":"Delete All Worklogs","id":"43"}],"name":"Time Tracking Permissions"}]";WRM.unparsedData["com.atlassian.plugins.atlassian-plugins-webresource-plugin:context-path.context-path"]="""";WRM.unparsedData["com.atlassian.plugins.browser.metrics.browser-metrics-plugin:browser-metrics.feature-data-provider-legacy"]="true";WRM.unparsedData["com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources.resource-uris"]="{"deployJava.html":"/s/en_UK2pighi/64005/131/1.5.13//download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/deployJava.html","clipboard.jar":"/s/en_UK2pighi/64005/131/1.5.13//download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/clipboard.jar","clipboard-legacy.jar":"/s/en_UK2pighi/64005/131/1.5.13//download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/clipboard-legacy.jar"}";WRM._unparsedData["com.atlassian.jira.plugins.jira-dnd-attachment-plugin:drag-and-drop-attachment-javascript.upload-limit"]=""10485760"";</script><script type="text/javascript" src="/s/04a3c59a6c4a6135626968f775a60a02-CDN/en_UK2pighi/64005/131/246/_/download/superbatch/js/batch.js?locale=en-UK" ></script><script type="text/javascript" src="/s/a933cc058b6261f91050bae177398501-CDN/en_UK2pighi/64005/131/198fc31d607a813456a26fbd5d39822e/_/download/contextbatch/js/atl.general/batch.js?locale=en-UK" ></script><script type="text/javascript" src="/s/d41d8cd98f00b204e9800998ecf8427e-CDN/en_UK2pighi/64005/131/f673d1e28f55b757ccfe8bccfcf831f9/_/download/contextbatch/js/jira.general/batch.js?hipchatToken=true" ></script><script type="text/javascript" src="/s/0809b839e385d5f0af04fb5e8041bc31-CDN/en_UK2pighi/64005/131/c58ba725f6c6164bad12048856fe2014/_/download/contextbatch/js/jira.global/batch.js?locale=en-UK" ></script><script type="text/javascript" src="/s/83f9ee60463444b76d4b2e62fed26460-T/en_UK2pighi/64005/131/2.1.7/_/download/batch/com.atlassian.jira.ext.calendar:browse-project-tip/com.atlassian.jira.ext.calendar:browse-project-tip.js?locale=en-UK" ></script><script type="text/javascript" src="/rest/api/1.0/shortcuts/64005/7334cc2b3b71589dd701f30ba5e3aee2/shortcuts.js"></script>
Encountered a "401 - Unauthorized"
error while loading this page.
First of all: Nice API, great peace of work!
One thing I miss is the support for remote links:
https://docs.atlassian.com/jira/REST/latest/#api/2/issue-createOrUpdateRemoteIssueLink
Would be great, if this could be supported in a future version.
Thanks for this superb library.
However, I'd like to retrieve started field of a worklog. There is a field for this: WorkLog.started
, and it is even filled with data in net.rcarz.jiraclient.WorkLog#deserialise
. However, there is no accessor method for this field.
The same is with WorkLog.timeSpent.
Is there any reason for this? I would be grateful if you could add these methods.
Just add something like this at the end of method realExecute() in class FluentTransition.
// Workaround JRA-33909
Status oldStatus = status;
refresh();
if (oldStatus != null && status != null && oldStatus.getId().equalsIgnoreCase(status.getId())) {
throw new JiraException("Missing required fields for this transition in " + key);
}
First of all, your code is very clean and well structured.
I have a request though. Mostly I use jira rest api to clone a ticket. Is it so difficult to add cloneIssue(bool copyLinks, bool copyComments ...) method to Issue.java ?
Thanks for your hard work.
There are different bugs or at least it should be assumed that things vary from one version to another.
One of the things is obtaining the sprint from the sprint report - the json format is wrong.
The json format is
conents: {},
sprint: {}
not
contents { ... sprint : {} .. }
The other thing is that date formats can vary.
Hi there,
first of all, amazing work you have done!
I'm currently using your client, and all is working properly, but i have to issues with the api, that prevent me from using this to access my jira.
First of all, why is it, that the classes are defined final? It prevents me from extending those classes with additional functionality, all the time i have to write wrapper classes. It would be nice to direcetly extend your classes.
Second is Serialisation. I would like to serialize those issues, but it's currently not possible due to the missing of no-arg constructors and setters. Point is, this would enable me to transform the contents to other issue classes (external issues).
Well, i hope, you can take some of those suggestions into considerations.
Best Regards
Zahtu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.