Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter a custom select field

Miyako Jones April 5, 2019

I created a Connect app that defines a custom issue field that is updated programmatically. The list of options is very large so I would like to filter them based on the project key of the issue it's being used on. Is using an issue field template the way to go? If so, how do I create one?

The structure of each option is like this:

    {
      "id": 1,
      "value": "d00101",
      "properties": {
        "projectKey": "DEV"
      },
      "config": {
        "scope": {
          "projects": [],
          "projects2": [],
          "global": {}
        },
        "attributes": []
      }
    }

 Thank you in advance.

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2019

Would it not be better to create multiple contexts so that the select list can have different options by project?

Miyako Jones April 9, 2019

So, don't create the custom field as part of a Connect App and manually create contexts? Can you explain how to do this or provide links?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2019
Miyako Jones April 22, 2019

Since the issue field will have hundreds of options and because I'd almost finished the app, I did some more experimenting and found out that limiting the project availability for each option using the config property works fine. https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-field-fieldKey-option-post

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events