Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update Query issue multi linker custom field using REST API #23

Open
deevant07 opened this issue Feb 3, 2016 · 1 comment
Open

Comments

@deevant07
Copy link

I have a custom field of type "Query issue multi linker custom field" which needs to be updated from REST API.
Facing 2 problems: using the rest path http://localhost:8080/rest/api/2/issue/ND-1

I am able to update custom field with one value if the issue is not assigned to any value but if the value is already assigned it is not allowing to update.
I am not able to update multiple values for the custom field.

Please help on this with appropriate REST API

@stevegoossens
Copy link

I also cannot set multiple values for this type of customfield as it appears to only accept string types, and no variations of list/arrays or json is accepted (string-wrapped objects can succeed to get an issue created, but the field (even though requires a value) has no values set in the resulting ticket.

Single value as string succeeds:

{"fields":{"description":"Creating a ticket via REST API\nMulti-line","reporter":{"name":"[email protected]"},"customfield_10351":{"value":"P4"},"assignee":{"name":"[email protected]"},"customfield_10286":[{"value":"Other"},{"value":"Cloud"}],"customfield_10052":"2016-03-25T22:41:00.000+0000","customfield_10442":"Service impact is something something","summary":"REST API test","customfield_10314":[{"value":"OTG-Foundation"},{"value":"OMG"}],"customfield_12601":"SERVICE-138","customfield_10312":[{"value":"Test"}],"customfield_10474":[{"value":"User"},{"value":"Zenoss"}],"project":{"key":"OPS"},"issuetype":{"name":"Incident"}}}
response status code = 201
{"self": "https://jira-test.dev.bbc.co.uk/rest/api/2/issue/884288", "id": "884288", "key": "OPS-160054"}

Array of strings fails:

{"fields":{"description":"Creating a ticket via REST API\nMulti-line","reporter":{"name":"[email protected]"},"customfield_10351":{"value":"P4"},"assignee":{"name":"[email protected]"},"customfield_10286":[{"value":"Other"},{"value":"Cloud"}],"customfield_10052":"2016-03-25T22:41:00.000+0000","customfield_10442":"Service impact is something something","summary":"REST API test","customfield_10314":[{"value":"OTG-Foundation"},{"value":"OMG"}],"customfield_12601":["SERVICE-138","SERVICE-747"],"customfield_10312":[{"value":"Test"}],"customfield_10474":[{"value":"User"},{"value":"Zenoss"}],"project":{"key":"OPS"},"issuetype":{"name":"Incident"}}}
response status code = 400

Array of single key-pair dicts fails:

{"fields":{"description":"Creating a ticket via REST API\nMulti-line","reporter":{"name":"[email protected]"},"customfield_10351":{"value":"P4"},"assignee":{"name":"[email protected]"},"customfield_10286":[{"value":"Other"},{"value":"Cloud"}],"customfield_10052":"2016-03-25T22:41:00.000+0000","customfield_10442":"Service impact is something something","summary":"REST API test","customfield_10314":[{"value":"OTG-Foundation"},{"value":"OMG"}],"customfield_12601":[{"key":"SERVICE-138"},{"key":"SERVICE-747"}],"customfield_10312":[{"value":"Test"}],"customfield_10474":[{"value":"User"},{"value":"Zenoss"}],"project":{"key":"OPS"},"issuetype":{"name":"Incident"}}}
response status code = 400
{"errorMessages": [], "errors": {"customfield_12601": "Operation value must be a string"}}

The schema for the customfield appears to only allow set operation:

        "customfield_12601": {
            "operations": [
                "set"
            ],
            "required": true,
            "name": "Core Service Impacted",
            "schema": {
                "items": "string",
                "customId": 12601,
                "type": "array",
                "custom": "ru.mail.jira.plugins.lf.queryfields:mailru-multi-linker-field"
            }
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants