Discussion
Encoding issue
I have a simple ruby code, API call that get user story description -> append it a 'new string' -> call 'save' the user story with new description
This add weirds characters to the old description like Â
I'm using https://github.com/yltsrc/targetprocess-ruby
after the 'get' user story description, 'set' it description and even after 'save' the new description - I checked the encoding and it seems as #<Encoding:UTF-8>
but after the 'save' the description contains weirds characters like Â
old description:
"<div>\r\n<div>BlaBla</div>\r\n\n<div>Change this behavior to allow login and show the <a href=\"https
after description:
"<div><b>new string</div>\r\n\n<div>\r\n<div>BlaBla</div>\r\n\n<div>Change this behavior to allow login and show the <a href=\"https
Any Ideas what could I fix this?
Thanks,
Liran
Posted by Liran Rom about 7 years ago
Find Projects with specific users using the projects API
Is it possible to use the projects API endpoint (or another endpoint) to find projects where a user is assigned.
I can use the endpoint `/api/v1/projects?include=[Id,Name,ProjectMembers[User]]` which returns each project and the users assigned however it only returns the first 25 users of each project. I would also ideally like to only return the projects that have a certain user assigned which this does not do. Is there a wherehas statement that can be used with the API that will return only entities that have something in a nested object?
Posted by Sam about 6 years ago
Mashup help
We're writing a mashup to select a bug and do an operation on it. I can make a text field to make the user type the number and hit a button, but it would be great to re-use the Entity Selection UI that's used for selecting an entity for a relationship as shown in the screenshot attached.
I've looked in the library for an example, and can't find one currently.
Phil
Posted by Phil about 6 years ago
portfolio tab mashup
how to add portfolio tab mashup
Posted by J about 7 years ago
API data models
How would you recommend I go about trying to understand what the API data models look like?
Posted by Targetprocess Support over 7 years ago
Mashup for moving custom fields
Hi,
I have created a mashup for moving some custom fields to their own tab in the detail view. It is working, apart from some quirks. I would like some help in resolving the quirks.
1. If I open the tab I created, the static markup I create in the mashup gets rendered, but the moved fields don't show up. When I refresh the browser, they do show. The static content is rendered in the `addTab` function. The custom fields are moved to pre-defined `<div>`s that are in the static content, this happens in the `onRender` function.
2. In the process of moving the custom fields, I add some explanatory text to each field's label. This works fine, until I edit the value of a field. In that case the whole field, including the label, gets re-rendered and my explanatory text for that field gets lost. Doe you have any suggestions how to resolve this?
Best regards,
Bart Kummel
Posted by Bart Kummel almost 6 years ago
Curl Upload Attachments
Hi! I am trying to upload files to tasks as Attachments with curl. But there is no examples how to do it. Could you share a link?
Posted by Pavel Kubitski almost 4 years ago
Correct JSON format for setting the state field on an item
I am trying to change the state of a request through javascript (Google script to be exact) but it is not executing and I am assuming that it is how I am forming the payload or defining the EntityState Name value. I can use the same script to update custom fields with a different payload and that is why I am assuming the issue is with the format of the payload. Here is my code.
// sets the state in TP for the change on the spreadsheet.
function setState(TP, state) {
var payload = {
"EntityState" : {'Name': state}
};
var options = {
'method': 'POST',
'payload': JSON.stringify(payload),
'contentType' : 'application/json',
};
var TPid = TP.toString();
var token = "?&access_token=mytoken&format=json";
UrlFetchApp.fetch("https://kofile.tpondemand.com/api/v1/Requests/" + TPid + token, options);
}
Posted by Steve Russell about 6 years ago
Querying and updating Assignable substates
We are using SubEntityStates in our workflow that looks something like this (substates in brackets):
Backlog -> Ready -> Development [In Dev -> Code Review -> Dev Done] -> Testing [...] -> Done [Accepted, LIVE, ...]
I'm building internal integration that uses the targetprocess REST API v1 to (among other things) query and update entity states. I can already achieve these for the parent states, but I can't find the current substate of an Assignable in the API response and trying to update the EntityState to a substate returns with an error.
For example, I have a UserStory that shows on the web interface to be in "In Dev" state, but the EntityState returned by the API is "Development" (the parent state). When I try to update EntityState to "Code Review" this is what I get:
```
POST /Assignable/60091 {"EntityState": {"Id": 2961}}
{
"Status": "BadRequest",
"Message": "Invalid entity state 'Code Review' for UserStory.",
"Type": "Presentational",
"Details": {
"Items": [
{
"Type": "BrokenRule",
"FieldPath": {
"EntityKind": "UserStory",
"Column": "EntityState"
},
"Message": {
"Token": "Invalid entity state '{entityStateName}' for {entityKind}.",
"Data": {
"entityStateName": "Code Review",
"entityKind": "UserStory"
},
"Value": "Invalid entity state 'Code Review' for UserStory."
},
"Details": null,
"Resolution": null
}
]
},
"ErrorId": "067dd05f-9adf-42db-94e6-d999bdd90cc0"
}
```
Am I missing something or is this not supported by the current APIs?
Posted by László Bácsi almost 3 years ago
Mashup triggered on split
Is it possible to have an mashup that is triggered when selecting the split function? We would like to tweak the content based on different rules on during the split
Posted by Julia over 6 years ago