I build an application to create issue in jira using jira-rest-java-client version 1.0
Now I updated the lib version to 2.0.0-m5 because I need to update some issue, but I don't find how. I read from this issue that this version should implement it, but I don't find it.
How can I do it?
Community moderators have prevented the ability to post new answers.
I know it's been a few months, but I'll just leave this here for anyone who encounters the same issues I did...
Public documentation for JRJC is awful. The tutorial is for verison 1.0, the JavaDocs reference 0.4, and the website makes no reference to what the current version actually is. You have to look at the Maven repo to find that out. Version 1.1 seems to suppot updating but thanks to a bug in Apache Commons HTTP library, it doesn't work with my company's SSO gateway.
Atlassian forked httpclient and seems to be merging upstream changes in. But since the source code isn't available there's no way to know exactly what they changed. So I can't fix the bug without tearing out httpclient and replacing it with the supported version from Apache. And JRJC 2.0 is not useful to me because it's missing a bunch of needed functionality. I would add the missing functionality but the design is too ridiculously complicated.
So since all I really wanted was a library that *helped* I decided it was easier to write my own. If you're deciding between JRJC and an alcohol-induced coma, you might find https://github.com/rcarz/jira-client helpful.
Bob,
With the latest JIRA v7.2.6, does your "jira-client" still work with that version of the REST API and would be easy to work with future versions? I am currently having issues with retrieving a simple ticket in our DEV system using the example from this link.
https://github.com/rcarz/jira-client/tree/release-0.5
Please let me know your thoughts.
Thanks.
Traolly Xiong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should work. The public release is pretty old so you may need to pull master and build it. I'm working to get a bunch of PRs merged and tested before making a new public release.
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.
issueBuilder.setFieldValue("customfield_10000", ComplexIssueInputFieldValue.with("value",customerId));
when I do this,there is an error like this:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Operation value must be a string
do you know why?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luca,
it would be great if you could post your pom.xml and code snippet here for issue creation in jira using jrjc-1.0, since I spent a lot of time trying to figure out right dependencies for the job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you send me the link for 2.0.0-m5 release? I can't find the jar for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting. If during creating of a jira issue in the UI allows one to select a custom drop down of
severity leve, would you agree that with the JRJC 1.0 transition will give you the capability
to change that custom field?
The other easiest way to do this is use the REST API it self in java using one of the other Jersey classes.
Thanks in advance.
TRX
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Transition is about changing state of existsing issue, so I don't see the connection beetween the create issue UI and possibility to change customfield while doing transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you elaborate what you mean by editable during transition?
I was able to edite the custom field via one of Jersey's class.
Thanks.
TRX
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When the transition is configured in a way that you can change field value (for example to fill the resolution field while using resolve transition) then rest client 1.0 is able to set that field when performing transition. But I suppose that this is not what you need.
As example see the assertTransitionWithNumericCustomField method: https://bitbucket.org/atlassian/jira-rest-java-client/src/f181d6425ba3fa8aa33f66c23c63f63471fcc44a/src/test/java/it/JerseyIssueRestClientTest.java?at=jira-rest-java-client-1.x
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any way to update a custom field with JRJC 1.0?
Any help is fully apreciated.
Regards,
TRX
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, updating issues is not available in JRJC 1.0. You can only change values of fields that are editable during transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not yet possible in 2.0.0-m5. I've repoened that issue, sorry for the confusion.
The code need to be merged back from old 1.1 branch. You can use 1.1-m02 milestone release, but this code (the old 1.x version) rather won't be supported anymore.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aleksander,
I tried version 1.1-m02, but I can't update custom field.
I get this error:
Field 'My Custom Field Name' cannot be set. It is not on the appropriate screen, or unknown.
I updated them building a map like this:
List<FieldInput> fields = new ArrayList<FieldInput>(); fields.add(new FieldInput(fieldName, fieldValue)); issueClient.update(issue, fields, pm);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume that you can edit this field in JIRA (so the screens are configured correctly).
The problem is that you're using field name instead of field id - you should pass something like customefield_10020 to the FieldInput as first parameter.
client.getIssueClient().update(issue, ImmutableList.of( new FieldInput("customfield_10020", "test value 1") ), pm);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I can edit the custom field in the JIRA edit screen and I tried your solution, but I didn't work.
The field is a CustomFieldOption, but it didn't work in any way that I tried.
If I put the first parameter as the name of the customField I get this:
Field 'Categoria Requisito' cannot be set. It is not on the appropriate screen, or unknown. at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68) at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.update(JerseyIssueRestClient.java:223) at it.eng.api.jira.rest.RestClient.updateIssue(RestClient.java:185)
If I put the first parameter ad customfield_*** I get this error:
Could not find valid 'id' or 'value' in the Parent Option object. at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68) at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.update(JerseyIssueRestClient.java:223)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
for complex fields (those which contains more than a text or number) you need to use ComplexIssueInputFieldValue, as the REST API expect object there.
For Select List custom field (which I believe you're talking about) you may pass a option value or id:
// select by option id client.getIssueClient().update(issue, ImmutableList.of( new FieldInput("customfield_10140", ComplexIssueInputFieldValue.with("id", "10022")) ), pm); // select by option value client.getIssueClient().update(issue, ImmutableList.of( new FieldInput("customfield_10140", ComplexIssueInputFieldValue.with("value", "green")) ), pm);
Does that solve your problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Aleksander,
I'm right at this point ("Does that solve your problem?"). At first I got response 400 when attempting to update customfield_10006 (Rank). So, I let this field show in the screen. Now I get response 500 (Internal server error). I must be using the API incorrectly, in particular ComplexIssueFieldValue.with(). Can you help, please? Here is my code.
String fieldId = "customfield_10006"; final NullProgressMonitor pm = new NullProgressMonitor(); IssueRestClient irc = restClient.getIssueClient(); irc.update(issue, ImmutableList.of(new FieldInput(fieldId, ComplexIssueInputFieldValue.with("value", "22"))), pm);
The Issue object is fine. I can get the field from it and print its value (currently 28). So, I'm making a mistake on the last line, I think. Thank you for any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it! I suppose my mistake was trying to update customfield_10006/Rank as I was. So, I created a custom numeric field and updated it.
String fieldId = "customfield_10006"; final NullProgressMonitor pm = new NullProgressMonitor(); IssueRestClient irc = restClient.getIssueClient(); restClient.getIssueClient().update(issue, ImmutableList.of(new FieldInput(fieldId, 22)), pm);
Now I have 1.1-m02 working with the update functionality. It would be nice to see this merged into a trunk release. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to create issues of type Epic via JRJC? I have managed to add stories and sub-tasks but when I try the same sort of code as the Story for an Epic issue type I get an exception message indicating the field "Epic Name" is required:
Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: Epic Name is required. at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68) at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.impl(AbstractJerseyRestClient.java:164) at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.postAndParse(AbstractJerseyRestClient.java:152) at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.createIssue(JerseyIssueRestClient.java:398)
Looking at JIRA it seems this is a custom field (customfield_12601) but it is not obvious how I should set this using the issueBuilder. Is there any documentation you can direct me to for this? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@omerta: this is separate question, so please create one instead of a comment in existing question (it's not related to this one).
In short: it should be possible by using IssueInputBuilder#setFieldValue("customfield_12601", "Epic name") - I didn't tested it but I believe it should work ;).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No joy with that I'm afraid. Thanks for the suggestion Alexsander. As requested here is new question: https://answers.atlassian.com/questions/166580/not-able-to-create-epic-issue-type-using-jira-rest-java-client-jrjc#
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.