Hi,
I am trying to apply a transition on an issue that requires a mandatory field using the next format:
JIRA.transition_issue(bar_issue, 'FooTransition', customfield_bar='foo_name').
The response text to it is:
{"errorMessages":[],"errors":{"customfield_bar":"Custom Field Bar Name is mandatory"}}
Can it be done through the Python API? Could it be done without making the particular custom fields optional?
Thank you!
Hello @bogdanbustan
Can you try this:
jira.transition_issue(issue, '5', fields={'yourfield:value})
https://jira.readthedocs.io/en/master/examples.html#transitions
Hello @Mohamed Benziane thank you for your answer.
Sending the transition by name was not the issue as the function find_transitionid_by_name" in "client.py" worked.
I have tried something like this but I get the same answer.
jira.transition_issue(bar_issue, 'FooTransition', fields={'customfield_bar': {'name': 'foo_name'}})
I have also tried something like this:
jira.transition_issue(bar_issue, 'FooTransition', fields={'customfield_bar': {'name': 'foo_name'}, 'resolution': {'id':'foo_id'}})
Where "foo_id" is the resolution ID in the custom field from a transitioned issue, done manually to say so. It is a reversed engineered attempt, I guess. It still gives back the same error message as above.
{"errorMessages":[],"errors":{"customfield_bar":"Custom Field Bar Name is mandatory"}}
Do you know if is there any API call, Python API or traditional REST API request, that returns the required format for a certain field in order to be updated? That returns something similar to a JSON or dictionary?
Thank you!
LATER EDIT:
I have tried it again after I have replied to you and now it works. I cannot be sure if it was related to my code or there was a bug related to the JIRA Server. The working solution for me it was:
jira.transition_issue(bar_issue, 'FooTransition', fields={'customfield_bar': {'name': 'foo_name'}})
When I have tried them the other day there were indeed some intermittent connectivity issues.
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.