Skip to content

added ability to get, create and update custom select options in custom fields#7

Merged
lesstif merged 4 commits intolesstif:mainfrom
LordSimal:main
Aug 21, 2022
Merged

added ability to get, create and update custom select options in custom fields#7
lesstif merged 4 commits intolesstif:mainfrom
LordSimal:main

Conversation

@LordSimal
Copy link
Copy Markdown
Contributor

See lesstif/php-jira-rest-client#465

I have no idea why the official V3 doc does not match what is actually working.... but here we go

I am talking about the fact, that I had to prefix the custom field ID inside the called URL with customfield_, otherwise it wouldn't work / actually give an error mentioning this problem.

So in the end 4 new methods have been added to the Fieldservice:

  • getCustomFieldContexts() is needed to fetch the available context IDs for a given custom field (needed for all other methods added)
  • getCustomFieldOptions() fetches the currently present options in JIRA including ther ID, disabled state and value
  • createCustomFieldOptions() should be self explanatory - needs the context ID from above
  • updateCustomFieldOptions() as well - needs the context ID from above

I also noticed, that one can get the fieldId and contextId from the URL when editing the available options in JIRA Cloud:
https://yoursubdomain.atlassian.net/secure/admin/EditCustomFieldOptions!default.jspa?atl_token=long-token&fieldConfigSchemeId=10152&fieldConfigId=10152&customFieldId=10048

So the fieldConfigId GET Parameter is the contextId and customFieldId is the fieldId

This might be usefull to add to the readme as well because its not really obvious... but let me know what you think

@LordSimal
Copy link
Copy Markdown
Contributor Author

LordSimal commented Aug 19, 2022

Had to add another param for getCustomFieldOptions because we have select custom fields which have more than 100 options, therefore we need to pass the startAt query param to it as well to be able to paginate over all items

@lesstif lesstif merged commit ebd4550 into lesstif:main Aug 21, 2022
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

Successfully merging this pull request may close these issues.

2 participants