Rest API set issue visibility to "teamForProject"

Greetings,

Is it possible to set the issue visibility to the project team when an issue is created via POST to api/issues?

If so, a JSON example would be great.  If no - what would be the workflow?  (something simple I am sure)

0
3 comments
Official comment

Hi Robert,

thank you for your question. Sure, it's possible, here is an example:

 

POST https://example.myjetbrains.com/api/issues?fields=idReadable,visibility(permittedGroups(id,name))

{
  "summary": "Houston!",
  "description": "We have a problem!",
  "project": {
      "id": "81-1"
  },
  "visibility": {
      "$type": "LimitedVisibility",
      "permittedGroups": [
          {
              "name": "Project team",
              "id": "23-40",
              "$type": "UserGroup"
          }
      ]
  }
}
 
Response:
{
  "idReadable": "NP-169",
  "visibility": {
      "permittedGroups": [
          {
              "name": "Project team",
              "id": "23-40",
              "$type": "UserGroup"
          }
      ],
      "$type": "LimitedVisibility"
  },
  "$type": "Issue"
}

To send this request, you need to know the ID of the project and the ID of the project team.

Thank you.  What would be the endpoint and query (field list) to get the ID of the project team?

 

0

Here's an example of such a request:

GET https://example.myjetbrains.com/api/admin/projects/{projectID}?fields=shortName,team(id,name)

Response:

{
  "team": {
      "name": "Project Team",
      "id": "23-40",
      "$type": "UserGroup"
  },
  "shortName": "NP",
  "$type": "Project"
}
0

Please sign in to leave a comment.