Comments (12)
it should be {field :{"assignee":{"name":"user1"}}}
from jira-client.
The error message suggests that assignee is a string and not a dictionary. You would get this result if your JSON looked something like this {"assignee": "user1"} when it should be {"assignee": {"name": "user1"}}. The only way I could see this happening is if the editmeta data coming back from JIRA is wrong.
Can you try this instead?
tempIssue.update().field(Field.ASSIGNEE, Field.valueByName("user1")).execute();
That will force jira-client to send the value as a dictionary in the form of {"name": "user1"} instead of a string.
from jira-client.
I'll give a go tomorrow morning and let you know the outcome.
Thanks rcarz
from jira-client.
issue.update().field(Field.ASSIGNEE, Field.valueByName("robin")).execute();
Same error, I'm afraid:
400 Bad Request: {"errorMessages":[],"errors":{"assignee":"data was not an object"}}
Let me know if you need further details.
Thanks again
from jira-client.
Atlassian JIRA Project Management Software Version: (v6.3.14#6345-sha1:47b2bb0)
from jira-client.
Hello,
Thanks for the nice API.
I'm having the same issue when changing the assignee field.
My java code is:
User user = User.get(jira.getRestClient(), assignee);
issue.update().field(Field.ASSIGNEE, user).execute();
Adding a comment or making a transition in a workflow works.
Jira version is JIRA v7.1.1
Any idea?
Thank you
from jira-client.
@v1v : did you get around this issue? Thanks
from jira-client.
Also with
issue.update().field(Field.ASSIGNEE, Field.valueByName(username)).execute();
gave me the same error.
I will try to put tcpmon
between the endpoints to see what goes trough the wire and hopefully see that is only my fault. If I use the jira-client
in a standalone test application all goes well. My problem is in a custom jenkins plugin I want to make; when trying to update the assignee from a git comment. Maybe some other jar in the classpath ruins the rest call,even though it's not the case when adding jira comments or transitioning through the workflow.
from jira-client.
I was not able to reproduce this, so it would be very helpful to see the results of your capture.
from jira-client.
The capture gave me nothing due to some intranet restrictions. I got around it by calling the Jira rest API directly. Maybe the issue is fixed with the changes in this release iteration and not on the Maven central release and that is why you couldn't reproduce it.
from jira-client.
I can't change the ASSIGNEE too,
public void addAsignee(String numticket, String user){
try {
System.out.println(jira.getIssue(numticket).getAssignee());
System.out.println(jira.getIssue(numticket).getField(Field.ASSIGNEE));
jira.getIssue(numticket).update().field(Field.ASSIGNEE, Field.valueByName(user)).execute(); //THIS LINE DOES NOT WORK
System.out.println(jira.getIssue(numticket).getAssignee());
} catch (JiraException e) {
e.printStackTrace();
}
}
net.rcarz.jiraclient.JiraException: Field 'assignee' does not exist or read-only
at net.rcarz.jiraclient.Field.getFieldMetadata(Field.java:432)
at net.rcarz.jiraclient.Field.toJson(Field.java:535)
at net.rcarz.jiraclient.Issue$FluentUpdate.execute(Issue.java:171)
at abm.robot_automation.BotJiraV2.addAsignee(BotJiraV2.java:151)
at abm.robot_automation.App.main(App.java:16)
from jira-client.
In my case, Field.ValueTuple
was cause of the bug.
In the FluentTransition.realExecute()
method, it moves whole the entries in the member variable map fields
to the local variable map fieldmap
.
When fields
contains a value a type of Field.ValueTuple
, it doesn't move to fieldmap
properly. So the fieldmap
contains a entry that key is copied but value is null.
The workaround is passing the value as Map like this.
issue.transition()
.field(Field.ASSIGNEE, ImmutableMap.of("name", assignee))
.execute(TRANSITION_ASSIGN_ASSIGNEE);
from jira-client.
Related Issues (20)
- how can i link Confluence Page HOT 1
- Failed to create issue 400 400: Bad Request Issue$FluentCreate.executeCreate
- Can not get Worklog started date
- Delete issue HOT 1
- Import/feature is not working with custom field
- URIBuilder Chinese garbled problem
- Attachment download fails to authenticate
- Empty Date field in the Attachment object
- Exception in thread "main" net.rcarz.jiraclient.JiraException: Failed to search issues HOT 2
- Agile API have not been supported in Version 0.5
- with version0.5 in springboot, method getPriorities error, return 404
- Any plans to publish to Maven Central repository? HOT 1
- A dozen of latest pull requests are failing CI builds
- Not able to create ticket if fields is multiselect - getting net.rcarz.jiraclient.RestException: 400 : {"errorMessages":[],"errors":{"Customer":"expected Object"}}
- Create a new maven release with more precise time stamps for comments HOT 2
- Junit and mockito in dependecies
- Any plan to create new version
- net.rcarz.jiraclient.RestClient#buildURI is adding a null part in path and it is resulting in a 404 response. HOT 1
- Failed to create issue - Field expects an Iterable value
- Creating issues broken with JIRA v9 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jira-client.