Jira Custom Field user picker in search for "type: user", "collection: list"

Hi all!
I have next situation:
created custom watchers field for Jira Cloud using Jira custom field (beta); field type is user + collection: list (as far as we can have a number of users); BUT in advanced search we have Input instead of User Picker.
In case we have type: user without collection: list we have User Picker in advanced search.

Question #1: should be there added smth specific to User Picker in advanced search for type: user + collection: list?

We also think that User Picker for collection is not added yet because of beta version of Jira custom field (beta).
At the same time we have another problem. We tried to add searchSuggestions function to show suggestions for Input field (as a workaroud) but inputting any query doesn’t invoke our function (have nothing in console during tunneling).
In manifest.yml:

  jira:customField:
    - key: custom-watchers-field-app-hello-world
      name: Watchers Custom
      description: A custom watchers field.
      type: user
      collection: list
      readOnly: false
      function: main
      edit:
        function: edit
      searchSuggestions:
        function: search
  function:
    - key: main
      handler: index.runView
    - key: edit
      handler: index.runEdit
    - key: search
      handler: index.generateSearchSuggestions

Search function in index.jsx:

export function generateSearchSuggestions({
  query,
  user: { accountId },
  context: { cloudId }
}) {

  console.log('search - ', query);
  return [{
      value: "qwe",
      label: "QWERTY"
  }]
}

Question #2: what’s wrong with searchSuggestions function?

package.json:

  "name": "jira-custom-field-ui-kit",
  "version": "1.0.3",
  "main": "index.js",
  "license": "MIT",
  "private": true,
  "scripts": {
    "lint": "./node_modules/.bin/eslint src/**/* || npm run --silent hook-errors",
    "hook-errors": "echo '\\x1b[31mThe build failed because a Forge UI hook is being used incorrectly. Forge UI hooks follow the same rules as React Hooks but have their own API definitions. See the Forge documentation for details on how to use Forge UI hooks.\n' && exit 1"
  },
  "devDependencies": {
    "eslint": "^7.32.0",
    "eslint-plugin-react-hooks": "^4.2.0"
  },
  "dependencies": {
    "@forge/api": "^2.6.1",
    "@forge/ui": "1.1.0"
  }
}

Hello, @RomanHavryliv,

I think you mean basic search? Advanced search is when the user inputs raw JQL queries, basic search is the one where they can use the UI to select values.

Anyway, user list fields should show the user picker, just like singular user fields. It’s a bug that they currently don’t. I’m adding this to our backlog. Will let you know here when it’s fixed.

As for the search suggestions function, it only affects the values that are suggested in the advanced search, it doesn’t control the basic search experience.

2 Likes

Thank you @kkercz!
Waiting for bug fix :slight_smile: