Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Solved! Go to Solution.
@alfonso_c Thank you so much.
This is very helpful. We want show the Last Run Result in Test Case Tracker , Due to your inspiration we add a custom Text field with
first(1,downstreamReferences(this).trackerTypes("testrun").{item| item.resolutions[0].name}) formula and it works!
Hi, @YW_10142311 , I assume this is related to a Test Run. If so, to which part do you refer, is it the below?
@YW_10142311, you gave "Kudos" to my previous question, so I assume you are indeed interested in getting that field with REST API or computation.
To get the Test Result of a Test Case's Test Run, you can chain 2 REST API calls:
1) Assuming the Main Test Run has ID 2094 as in my screenshot above, get its child items with GET /v3/items/2094/children:
{
"page": 1,
"pageSize": 25,
"total": 1,
"itemRefs": [
{
"id": 2095,
"name": "Run of tc1",
"type": "TrackerItemReference"
}
]
}
2) Once you have the child item ID (2095), you can query its fields with GET /v3/items/2095/fields, the JSON will contain a part about the result:
{
"fieldId": 15,
"name": "Result",
"values": [
{
"id": 1,
"name": "Passed",
"type": "ChoiceOptionReference"
}
],
"sharedFieldNames": [],
"type": "ChoiceFieldValue"
}
With computation, you can e.g. add a custom Text field with the resolutions[0].name formula:
Does this help you?
@alfonso_c Thank you so much.
This is very helpful. We want show the Last Run Result in Test Case Tracker , Due to your inspiration we add a custom Text field with
first(1,downstreamReferences(this).trackerTypes("testrun").{item| item.resolutions[0].name}) formula and it works!