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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Want to use REST APIs to set comments on Test Cases

I am using the https://docs.adaptavist.io/tm4j/server/api/v1/ APIs to automate create, update, and executions in our server based TM.  One thing that I don't see is the ability to add comments (i.e. 'Comments' tab in the Test Case UI) via the APIs.

I see, through browser debugging, that a different API is being called by the TM UI of '/rest/tests/1.0/testcase/<id>/comments'.   I am able to POST with that same API and add a comment.  The problem I am having is that the <id> is a numeric (ex: 1534). I don't know how to determine that value from the normal <projectKey>-nnn key beyond watching the network call when visiting the Comments tab.

Is the '/rest/tests/1.0/ API documented somewhere? If not, does anyone know how to determine this id? 

1 answer

You can get a test case ID (number) from your test case key (string like PROJ-T123) using this request:

GET /rest/tests/1.0/testcase/PROJ-T123

The response will contain the id value you need:

{
"testData" : [ ],
"majorVersion" : 1,
...
"id" : 12345,
"key" : "PROJ-T123",

...

}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

340 views 3 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you