JiraLibrary update MultiValues custom filed

Hello,

I am trying to update JIRA tickets from tests Results in robotFramework with JiraLibrary.

It allows me to make type updates
- Update Issue Field ${JiraConnection} ${JiraTicket} {JsonKey:JsonValue} notify_users=True

For simple string and date fields it works well, but I have a problem with multiple fields.
Indeed one of my fields gives me possibilities NTE or KO or OK
When i get of my customField multivalues, it returns me these type infos
- {‘self’: ‘https://[MonJira]/rest/api/2/customFieldOption/62509’, ‘value’: ‘NTE’, ‘id’: ‘62509’, ‘disabled’: False}

If I replace the value with ‘KO’ (allowed value),
- {‘self’: ‘https://[MonJira]/rest/api/2/customFieldOption/62509’, ‘value’: ‘KO’, ‘id’: ‘62509’, ‘disabled’: False}
the keyword “Update Issue Field” runs but returns 204 without doing anything…it’s still “NTE”

I’m looking for the keyword and/or syntax to change only this multioptions value.

Did anyone already do that?
I don’t find much documentation of syntax use on this Library : would you have the doc other than that provided in library please

Thank you very much

Fabrice

Hi,

I’m using Jira and RF but through Xray and xml import to update results, so never used the Jira API directly.

However looking at the documentation here:

https://jira.readthedocs.io/_modules/jira/resources.html#Issue.update

And here:

https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#updating-multiple-fields

It seems the multiple fields need a dict with action to perform (remove previous, and add new value).
You can try to update your json {JsonKey:JsonValue} to something like the example:

{
“update” : {
“components” : [{“remove” : {“name” : “Trans/A”}}, {“add” : {“name” : “Trans/M”}}],
“assignee” : [{“set” : {“name” : “harry”}}],
“summary” : [{“set” : “Big block Chevy”}]
}
}

Regards
Charlie

1 Like

Yes, and when you think about the fact that http response was 304 … 3XX series according to wikipedia is class of status code indicates the client must take additional action to complete the request and more specifically 304 Indicates that the resource has not been modified - that gives a nice hint towards what you suggested :slight_smile: I would like to buy a beer to whom deciding that response code :beers:

I see he mentioned 204
That doc gave “Status code of “204 No Content”.”

But it’s indeed towards a nothing is set issue :slight_smile:

oh man, that ruined my fun :frowning: :slight_smile:

Good morning to you,

Thank you very much for your responses.
First…sorry… yes it was 204 :smile:

For the problem, it was an error on my part, i had to modify several things to be good and I had forgotten one.
So, the “Update Issue Field” works if you pass it the right info.

It is a good thing in fact, I searched and discovered the api thanks to you.

thanks again

Fabrice

2 Likes