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

[BUG] Autocompletion for field "labels" not working (with german field name) in "add subscription" mask #1143

Open
iva-5-middleware opened this issue Dec 5, 2024 · 0 comments
Labels
Type/Bug Something isn't working

Comments

@iva-5-middleware
Copy link

Hey there,

we have a problem with the autocompletion for the field "labels" (as filter) when trying to create a new subscription.

Our environment in short:

  • Mattermost Self-Hosted: 9.11.4
  • Jira Plugin: 4.1.1
  • Jira Data Center Self-Hosted: 9.12.15
  • Language: German

Steps to reproduce

  • Add new subscription
  • Add filter: "Stichwörter" (engl. labels), Type: INCLUDE; try to select a label from the dropdown ("No options")
  • Try to search for a label in the dropdown ("No options")

Current behaviour

  • No "Stichwörter" (labels) are shown in the dropdown

Expected behaviour

  • "Stichwörter" (labels) should be selectable (and/or searchable) in the dropdown

Troubleshooting

Google Chrome Debugging Console:

First user action

  • /jira subscribe edit, add new subscription, project "TESTI" is auto-selected

First request

REQUEST (TRIGGERED BY MM): GET https://<mm url>/plugins/jira/api/v2/get-create-issue-metadata-for-project?project-keys=TESTI&instance_id=https://<jira url>
RESPONSE:
{
    "projects": [
        {
            "expand": "description,lead,url,projectKeys",
            "self": "https://<jira url>/rest/api/2/project/10300",
            "id": "10300",
            "key": "TESTI",
            "name": "Testprojekt für alle #1",
            "issuetypes": [
				(...)
                {
                    "self": "https://<jira url>/rest/api/2/issuetype/10100",
                    "id": "10100",
                    "iconurl": "https://<jira url>/secure/viewavatar?size=xsmall\u0026avatarId=10311\u0026avatarType=issuetype",
                    "name": "Aufgabe",
                    "fields": {
						"labels": {
							"autoCompleteUrl": "https://<jira url>/rest/api/1.0/labels/suggest?query=",
							"fieldId": "labels",
							"hasDefaultValue": false,
							"name": "Stichwörter",
							"operations": [
								"add",
								"set",
								"remove"
							],
							"required": false,
							"schema": {
								"items": "string",
								"system": "labels",
								"type": "array"
							}
						},
					}
				},
				(...)

Second user action

  • add a new filter "Stichwörter" (labels), type: INCLUDE => dropdown shows "No options"
  • try to search for the string "test" in dropdown => dropdown shows "No options"

Second request

REQUEST (TRIGGERED BY MM): GET https://<mm url>/plugins/jira/api/v2/get-search-autocomplete-fields?fieldValue=test&fieldName=Stichw%C3%B6rter&instance_id=https%3A%2F%2F<jira url>
RESPONSE: {"results":[]}
PROBLEM in REQ URL: fieldName=Stichw%C3%B6rter (has to be "labels", not the german equivalent)

First debug api call

I replaced fieldName=Stichw%C3%B6rter with fieldName=labels

REQUEST: GET https://<mm url>/plugins/jira/api/v2/get-search-autocomplete-fields?fieldValue=test&fieldName=labels&instance_id=https%3A%2F%2F<jira url>
RESPONSE:
{"results":[{"value":"test","displayName":"\u003cb\u003etest\u003c/b\u003e"},{"value":"testinstallation","displayName":"\u003cb\u003etest\u003c/b\u003einstallation"},{"value":"testvw","displayName":"\u003cb\u003etest\u003c/b\u003evw"},{"value":"TEST","displayName":"\u003cb\u003eTEST\u003c/b\u003e"},{"value":"Test","displayName":"\u003cb\u003eTest\u003c/b\u003e"},{"value":"Test_JQL","displayName":"\u003cb\u003eTest\u003c/b\u003e_JQL"},{"value":"Testauftrag","displayName":"\u003cb\u003eTest\u003c/b\u003eauftrag"},{"value":"Testi","displayName":"\u003cb\u003eTest\u003c/b\u003ei"},{"value":"Teststichwort","displayName":"\u003cb\u003eTest\u003c/b\u003estichwort"},{"value":"Teststory","displayName":"\u003cb\u003eTest\u003c/b\u003estory"},{"value":"Testumgebung","displayName":"\u003cb\u003eTest\u003c/b\u003eumgebung"}]}

=> It works

Second debug api call

I took the autoCompleteUrl from the response of the first request

REQUEST autoCompleteUrl: GET https://<jira url>/rest/api/1.0/labels/suggest?query=test
RESPONSE:
<suggestionListStruct>
<token>test</token>
<suggestions>
<label>test</label>
<html><b>test</b></html>
</suggestions>
<suggestions>
<label>testinstallation</label>
<html><b>test</b>installation</html>
</suggestions>
<suggestions>
<label>testvw</label>
<html><b>test</b>vw</html>
</suggestions>
<suggestions>
<label>TEST</label>
<html><b>TEST</b></html>
</suggestions>
<suggestions>
<label>Test</label>
<html><b>Test</b></html>
</suggestions>
<suggestions>
<label>Test_JQL</label>
<html><b>Test</b>_JQL</html>
</suggestions>
<suggestions>
<label>Testauftrag</label>
<html><b>Test</b>auftrag</html>
</suggestions>
<suggestions>
<label>Testi</label>
<html><b>Test</b>i</html>
</suggestions>
<suggestions>
<label>Teststichwort</label>
<html><b>Test</b>stichwort</html>
</suggestions>
<suggestions>
<label>Teststory</label>
<html><b>Test</b>story</html>
</suggestions>
<suggestions>
<label>Testumgebung</label>
<html><b>Test</b>umgebung</html>
</suggestions>
</suggestionListStruct>

=> It works

Conclusion

The autocompletion of other fields (e.g. "priority") work as expected. The displayName for "priority" is "Priorität", which is selectable in the filters' dropdown menu. But the dropdown on the right shows all priority values.
Why doesn't this work with the labels field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type/Bug Something isn't working
Projects
Development

No branches or pull requests

2 participants