-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
1
-
When using the results from a GET-Request and transforming this to a PUT while modifying custom fields the API notifies that there is an issue with the fields not being on the screen or unknown.
{ "errorMessages": [], "errors": { "lastViewed": "Field 'lastViewed' cannot be set. It is not on the appropriate screen, or unknown.", "watches": "Field 'watches' cannot be set. It is not on the appropriate screen, or unknown.", "creator": "Field 'creator' cannot be set. It is not on the appropriate screen, or unknown.", "subtasks": "Field 'subtasks' cannot be set. It is not on the appropriate screen, or unknown.",
This message is returned even when the field is part of the screens. The issue is not related to fields not being part of the screen but related to how the PUT or update is formatted. The update format expected when editing an issue is the following mentioned on article API - Edit Issue.
- Example:
{"update":{"summary":[{"set":"Bug in business logic"}],"components":[{"set":""}],"timetracking":[{"edit":{"originalEstimate":"1w 1d","remainingEstimate":"4d"}}],"labels":[{"add":"triaged"},{"remove":"blocker"}]},"fields":{"summary":"This is a shorthand for a set operation on the summary field","customfield_10010":1,"customfield_10000":"This is a shorthand for a set operation on a text custom field"},"historyMetadata":{"type":"myplugin:type","description":"text description","descriptionKey":"plugin.changereason.i18.key","activityDescription":"text description","activityDescriptionKey":"plugin.activity.i18.key","actor":{"id":"tony","displayName":"Tony","type":"mysystem-user","avatarUrl":"http://mysystem/avatar/tony.jpg","url":"http://mysystem/users/tony"},"generator":{"id":"mysystem-1","type":"mysystem-application"},"cause":{"id":"myevent","type":"mysystem-event"},"extraData":{"keyvalue":"extra data","goes":"here"}},"properties":[{"key":"key1","value":'properties' : 'can be set at issue create or update time'},{"key":"key2","value":'and' : 'there can be multiple properties'}]}
Please add a validation that the format is not correct on the API instead of notifying that the issue is related to the field not being part of the screen or unknown.