4

I am new to Jira and I created jira custom app using Atlassian connect express.     I used api from https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/ Atlassian components from https://atlassian.design/components/ In my app there is two filter dropdown is present, one is for columns and another is status of issues in jira.    For saving the filter view, I followed the below steps:- 

  • Create filter on save button. (/rest/api/3/filter.)
  • Search filter for get all created filter. (/rest/api/3/filter/search).

But the problem occur after create filter that only the status filter is saved properly, but columns are not saved in it. 

I tried to set columns after the filter is created but it not work for me.

  • Used set columns api. (PUT /rest/api/3/filter/{id}/columns) 
  • Also try to get columns. (GET /rest/api/3/filter/{id}/columns). 

Here I attached my github link please refer it. 

Please help me in this if any one has idea about this.

Thanks. 

2 Answers2

0

yes, you can do that:

you make a GET to https:///rest/api/latest/filter/<filterId>/columns

and the jira should response with something like:

[
    {
        "label": "Issue Type",
        "value": "issuetype"
    },
    {
        "label": "Priority",
        "value": "priority"
    },
    {
        "label": "Created",
        "value": "created"
    },
    {
        "label": "Status",
        "value": "status"
    },
    {
        "label": "Key",
        "value": "issuekey"
    },
    {
        "label": "Summary",
        "value": "summary"
    },
    {
        "label": "Creator",
        "value": "creator"
    },
    {
        "label": "Assignee",
        "value": "assignee"
    },
    {
        "label": "Story Points",
        "value": "customfield_124"
    }
]
ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
  • 1
    Thanks for responding, I created new filter and save it. By using this api rest/api/3/filter/search I got list of created filters with id. I tried /rest/api/latest/filter/10082/columns , but it shows the error of page can’t be found. – Kuldip panchal Aug 18 '22 at 11:37
0

The reason for the GET error could be that your filter doesn't have its own column config yet. If you create manually a filter and choose in columns the option "Filter" then the GET works properly. I'm still figuring out how to set that config with Jira API.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 23 '23 at 22:54