atlassian / atlassian/atlascode

bug[JIRA]: Custom fields cannot display available values from `autocompletedata/suggestions` endpoint

Open
#23 6 comments 0 reactions 0 assignees View on GitHub
JIRA server
Dominant language
TypeScript
Stars
129
Forks
82
Avg merge
3h 3m
Merged PRs (30d)
6

Description

When reviewing `Related Jira Issues` from a BB Server PR, the Jira issue UI will create a new tab in VSC. This seems to be working fine after the work around is applied from this comment https://bitbucket.org/atlassianlabs/atlascode/issues/756#comment-67516278

While working on the related Jira Issue, when I attempt to change the `Feature Link` custom field value, the endpoint `http://{baseurl}/rest/api/2/jql/autocompletedata/suggestions?fieldName=Feature Link&fieldValue=25Q1` does not return any results because the actual field name is `Epic Link`, not `Feature Link` as displayed on the UI.

![image](https://github.com/user-attachments/assets/e8d3492f-fc0e-40c6-9647-c800181fdf02)

You can find the actual field names by calling `https://.com/rest/api/2/jql/autocompletedata`

```json
{
"value": "\"Epic Link\"",
"displayName": "Feature Link (Epic Link) - cf[10001]",
"auto": "true",
"orderable": "true",
"searchable": "true",
"cfid": "cf[10001]",
"operators": [
"=",
"!=",
"in",
"not in",
"is",
"is not"
],
"types": [
"com.atlassian.jira.issue.Issue"
]
},
```

This is a sample call from the current extension which does not return any results. It does not return any error either to inform the UI of no results found. The UI seems to hang while searching forever with `Loading...` displayed.

```bash
[2024-12-04 17:55:38:562]
curl -X GET "https://.com/rest/api/2/jql/autocompletedata/suggestions?fieldName=Feature Link&fieldValue=25Q1" \
-H "Accept:application/json, text/plain, */*" \
-H "Content-Type:application/json" \
-H "User-Agent:atlascode/2.x axios/0.19.2" \
-H "X-Atlassian-Token:no-check" \
-H "Authorization:Bearer "
```

If I manually call this api with the query modified with the correct field name, results are returned successfully.

`curl -X GET 'http://{baseurl}/rest/api/2/jql/autocompletedata/suggestions?fieldName=Epic%20Link&fieldValue=25Q1'`

I’m not sure if this is related to custom fields or not, but it’s not registering the correct field name when then url is generated.

---

Atlassian Bitbucket v8.19.10

Atlassian Jira [Project Management Software](https://www.atlassian.com/software/jira) (v9.12.15#9120015-sha1:4d9c4bd:jira-2)

Name: Jira and Bitbucket (Atlassian Labs)
Id: atlassian.atlascode
Version: 3.0.14
Publisher: Atlassian
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=Atlassian.atlascode

Windows 11

Contributor guide

Open the contributing guide

Research direction

Start by tracing the related Jira issue custom-field UI to the autocomplete suggestions request. Compare the displayed field name with the value returned by Jira's autocompletedata endpoint, using the sample Feature Link/Epic Link request as the reproduction. Done means custom-field suggestions return results and the UI no longer remains stuck on Loading when the display name differs from the API field name.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
api, devtools, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.