Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,785
Community Members
 
Community Events
184
Community Groups

Insight API: How to change the value of an objectattribute which has the type: "Status" ?

I have an object type with a field of the status type . It has 3 available states:
Running, Stopped, Closed

 

I want to change this value through the API.
This is how I tried:

{

            "objectTypeId":698,

            "attributes"

     [

                {

                        "objectTypeAttributeId"2999,

                        "objectAttributeValues"

                            [

                               {

                                   "value""Running"

                                }

                            ]

                }

      ]

}


This returns error. Sadly the documentation for the API is no longer available ( at least not currently), so I don't know where to look up the exact method for doing this.

3 answers

1 vote
Rudy Holtkamp
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 13, 2022

Hi, 

A bit late to the party, but for anybody who is running into this issue.

You need to use the status id instead of the status name in your JSON .

You can find the status id via a 'Get https://api.atlassian.com/jsm/insight/workspace/{workspaceId}/v1/config/statustypewhich is explained here. 

If you status id for 'Running' is '5', your JSON will look something like this:

{
"objectTypeId":"698",
"attributes":[
{
"objectTypeAttributeId":"2999",
"objectAttributeValues":[
{
"value":"5"
}
]
}
]
}
1 vote
Neil
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 08, 2021

Hi @Koczka Bence So, I'll start by saying that I'm not personally familiar with the Insight API, therefore, I do not know if updating that particular objectTypeAttribute is possible; however, I believe the docs for that method are located here:

https://developer.atlassian.com/cloud/insight/rest/api-group-objecttypeattribute/#api-objecttypeattribute-objecttypeid-id-put

Hopefully that helps. Otherwise, share the exact call you're making (as many details without sensitive info), and the error responses you're getting, and we'll try to get the right folks on here to help.

Hi!


Thank you for your answer, sadly I have not mangaed to solve my problem.

I have an ObjectType called 'Server', and it has several ObjectTypeAttributes, one of them's value is what I want to change, it is called 'State'. It is a 'Status' type attribute. It has 3 available states:
Running, Stopped, Closed

 

The following is the content of a PUT request I've sent to:

https://ourjiraserver.com/rest/insight/1.0/object/255207



{

            "objectTypeId":698,

            "attributes": [

                {

                        "objectTypeAttributeId"3015,

                        "objectAttributeValues": [

                        {

                            "value""Closed"

                        }

                            ]

                }

                    ]

             }

 

The response is 500 internal server error:

{

    "errorMessages": [

        "Something went wrong. Contact administrator"

    ],

    "errors": {}

}

 

I can change any other (Text type) attributes with requests like this.

"Value": "Closed" is just a guess from my part (about how should I change an attribute which has the type 'Status'), since the old Insight documentation is sadly no longer available online.
I think it is the line which contains the error.
Please let me know if you need further information regarding my problem.

This is my reponse, accidentally posted from my other account.

Hi Koczka
You could try the same call but using the status id instead of the name of the status, you can check the status id in the schema configuration view.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events