Discussion
Extend view conditionally based on entity's project name or team name or whatever
I'm trying to add new block to the entity view based on which project or team this entity belongs to. So I have couple of questions:
1. now I use view.onRender method's second argument to figure out entity's Id and then I make GET request to /api/v1/Assignables/:id in order to get full entity's data. Is there more elegant way to do this?
2. Then I can't use view.addBlock method since looks like it doesn't work from async callbacks, do I have to use manual DOM manipulations in order to make it work?
3. Even If I use addBlock, it's only added above all existing blocks, can I change its position or order?
thanks!
Posted by Maxim Valenko over 6 years ago
Print mashup: How can I have info of features and projects
Hi,
I am doing a print cards mashup for tasks, bugs and US.
If I print a task I want to see the id and name of the user story that it is linked to and the ID and name of the project that the task belongs;
If I print a bug, I want to see the US id and name that it is linked to and the ID and name of the feature and project that the bug belongs to
If I print a US i want to see the ID and name of the feature and project that the bug belongs to.
Can you please tell me how can I have that info in javascript and calling the API? Thanks.
Posted by Diana Paiva over 7 years ago
How to delete Test Steps?
Hi,
I'm trying to delete test steps by, Id but it doesn't work.
What is the alternative?
Thanks.
Regards
Posted by Rui Escada over 6 years ago
How can I assign user(s) to TestPlanRun?
I'd like to assign users to TestPlanRun entity via Target Process REST API
How can do this?
Posted by Anna over 6 years ago
Custom Date Fields with API
I saw in the documentation how to create a new entity using the API with XML. Is the format the same for JSON, and if so can dates be added in the same way?
For example, if I wanted to create an entity in the project with id 1 and with a custom date field called FinalLiveDate, would the following work? If not what do I need to change?
POST /api/v1/UserStories?resultFormat=json&resultInclude=[Id,Name,Project] HTTP/1.1
Content-Type: application/json
{Name:"New Userstory",
Project:{Id:378},
CustomFields:{
Field:{
Name:"FinalLiveDate",
Value:"3/31/2017"
}
}
}
Posted by Matthew about 7 years ago
Autenticate via Bearer authentication header?
Hello! We recently changed our TP installation so that it uses Azure AD authentication with SSO/SAML. We have some C# .net applications that connects to TP via the REST API. Would it be possible to authenticate via the Microsoft Identity Framework?
I did some tests using the AcquireTokenInteractive method against the TargetProcess app in Azure AD, and has succeded in getting an access token. However, this token is not respected by TP when added to the headers (Bearer).
Would it be possible to use this approach or is it TP's own access tokens that is the only solution?
Posted by Anders Stenman over 4 years ago
Pulling CustomFields from Inner Collections
Hello, I am making a small report and am struggling to receive the CustomFields information on an inner collection. In particular, I am looking reach the CustomFields collection for Time entries via the /Users endpoint.
It seems when I use something of this sort:
&include=[FirstName, Times[Spent,CustomFields]]
that I receive the CustomFields for the "Items" collection within "Times" object. In my case, this collection is always empty, and I am instead looking for the CustomFields on each particular Time item. I have had success in getting the correct information with a second API call, but I would like to receive all relevant information in a single call if at all possible. Any help would be much appreciated!
A small sample response:
{
"Items": [
{
"ResourceType": "User",
"Kind": "User",
"Id": 1,
"FirstName": "Administrator",
"Times": {
"Items": [
{
"ResourceType": "Time",
"Id": 215,
"Spent": 1,
"Assignable": {
"ResourceType": "Assignable",
"Id": 1670,
"Name": "Test story"
},
"User": {
"ResourceType": "User",
"Kind": "User"
}
},
{
"ResourceType": "Time",
"Id": 208,
"Spent": 2.1,
"Assignable": null,
"User": {
"ResourceType": "User",
"Kind": "User"
}
}
]
},
"CustomFields": []
},
{
"ResourceType": "User",
"Kind": "User",
"Id": 9,
"FirstName": "Tanya",
"Times": {
"Items": []
},
"CustomFields": []
}
]
}
Posted by Jordan Martin almost 7 years ago
Automatically add a tag to a Request when it is created
We are using Service Desk and we would like to add a tag to every Service Desk request when it is created. It doesn't look like it can be done with standard custom rules and might require using something like web hooks. Is there a recommended way to do this and any samples would be greatly appreciated.
Posted by Steve Russell about 5 years ago
How can i connect to api target process with python langage
Hello,
I have a request , i try to connect with python and i'm using the requests library . But i have a bad request Can you help me please ?
My script :
import requests
hostname = 'http://bedrock.tpondemand.com/'
authenticationToken = 'NTY1OnN0Vzg5S1VVSHRGNndyeVkwM3Z6enNEbnU0YjdBNVc4UUdvNjhPKzN3M1E9'
isTokenSetFromUserProfileTab = True
takeCount = 10
entityTypeResourceName = 'userstories'
filter = ''
includeFields = ''
headers = {
'content-type' : 'application/json',
'token': authenticationToken
}
dataUrl = f'{hostname}api/v1/{entityTypeResourceName}'
print(dataUrl)
r = requests.get(dataUrl, headers=headers)
print(r.json)
////////
Response
<bound method Response.json of <Response [401]>>
Posted by Sophiane kadem over 2 years ago
Get multiple assignables in "one" query.
I am trying to build a report using the API (but am open to other suggestions) of all the test cases in a release with their test steps .
I have all the test cases, but I don't see how to ask for the steps from several test cases at the same time. I know this doesn't work, but I'm hoping it communicates what I'm hoping for.
http://targetprocess/api/v1/Testcases/3,5,17,19,23,29,31,32/testSteps
Where this returns the test steps for test case 3, 5 ,17, 19, 23, 29, 31, and 32.
Basically, I'm hoping to avoid a large number of HTTP calls, but will do them if that's my only option (I can parallelize).
Posted by Brad Arlt about 7 years ago