How to get the current task dynaform in Process Maker? - business-process-management

I am new to working with process maker and I cannot figure out how to get the form for the current task in a process using the GET /cases/{app_uid}/current-task. I am able to create new cases using POST /cases, which go in the draft. I am also able to route those cases and put them in inbox using the /cases/{{app_uid}}/route-case. I can also figure out the variables using the process-variables API endpoint. But I cannot tell which variable is needed by the current task and how to get the options for it.
Is someone aware of this? How to get the dynaform for the current task?

You can use the Designer REST API to find the steps that are part of a given task. In particular, you might be interested in the /steps endpoint. Once you know the steps of a given task (including any dynaforms), you can get the information of the corresponding dynaform with the /dynaforms endpoint, which includes the definition of all Dynaform fields.

You can achieve this through the following steps:
First get the task UID and then call the REST Endpoint /api/1.0/{workspace}/project/{project UID}/activity/{Task UID}/steps to get all the steps for that task.
Iterate through the steps to get the UID of the first dynaform which is stored in step_uid_obj.
To access the Dynaform call the REST Endpoint /api/1.0/{workspace}/project/{project UID}/dynaform/{dynaform UID}. It returns a json object for the dynaform which stores all the properties of the dynaform and the fields.
In order to access the variables you can call the following REST Endpoint, which returns all the variables for that project.
/api/1.0/{workspace}/cases/{application UID}/variables

Related

ADO API: Builds-List incomplete list

I'm calling this API method:
https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/list?view=azure-devops-rest-6.0#response
My API url (with placeholder names):
https://dev.azure.com/MyOrgName/MyProjName/_apis/build/builds?api-version=6.1-preview.6
The results are mostly appropriate, except I get a filtered list of builds, and I can't seem to get all the builds I want. In particular, builds from several pipelines are simply missing, and I can't find any way to include them. There's no discernable reason why some builds are included, and some are not.
The filter options describe ways I could reduce it more, but that's not my goal. I want to retrieve builds which I am otherwise not getting. And I don't know what option that I don't know about which will get me the results I care about.
As you have already noticed, there is a maximum number of the objects that can be listed on the response body of each API call. Normally, if the objects you want to list are too many, they will be returned in multiple pages.
In the response body of each call, generally there is a parameter 'continuationToken' (see here). You can access the next response page via calling the API with this parameter.
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds?continuationToken={continuationToken}&api-version=6.1-preview.6
For example:
the first call returns the list in the first page;
then run the second call with the parameter 'continuationToken' returned in the response of the first call to get the second page;
then get the third page using the 'continuationToken' returned in the second response;
. . .
until the last page.
If you want to traverse all the pages, you may need to call the API in a loop.

How do you get available Iteration Paths from Azure DevOps Services REST API?

I cannot find how to retrieve the iterations Paths from the API. I was able to get the parent paths but not child paths.
Tried with below Get command. It is giving just parent iterations but not a child.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/classificationnodes?$depth={$depth}&api-version=5.0
I'm using powershell.
If you're trying to get child paths, try using:
GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations?api-version=5.1
{team} is not required. You can check this document for more details.
More details:
1.Assuming I have such Iterations:
2.Use this Get request in postman to test:
https://dev.azure.com/MyOrgName/MyProjectName/_apis/work/teamsettings/iterations?api-version=5.1
3.The response will list all child Iterations like this:
A bit late, but the issue is likely that the url contains a $ which needs to be escaped with a ` in powersell so it doesn't get interpreted as the start of a variable name.

Retrieving More columns as Part of VSTS query

I'm trying to fetch details from VSTS using VSTS query API. So to get all Portfolio Epics I created a custom query and used its ID to get that in JSON format. the query looks like this
https://dev.azure.com/{organization}/{project}/{team}/_apis/wit/wiql/{id}?api-version=5.0-preview.2
But the issue is its not giving me many details about each of the work items in JSON. It only lists the ID and URL. Like this
WorkItems:[
{ID:234,URL:"workitemurl"},
{ID:235,URL:"workitemurl"},
{ID:236,URL:"workitemurl"},
...
]
So if I need more details about an item I need to execute those individual URl for each PE and thus I can get its details. instead of I am just checking is there is any way of getting an ID (keyedinID of each work item along with the ID and URL) like this. Please note KID is a field if we execute the URL separately. So to avoid that extra process, I would like to get that along with the WorkItems.
WorkItems:[
{ID:234,URL:"workitemurl",KID:002},
{ID:235,URL:"workitemurl",KID:023},
{ID:236,URL:"workitemurl",KID:033},
...
]
So how can we make this possible?
The Web UI uses a different API to get query results (/_api/_wit/_query), which allows query+data in a single pass. This is an old __v5 type call, which means it's considered internal.
The proper way to do this now is to first do the query as you're doing it right now and then call /_api/wit/workitems?ids=1,2,3,4 using the IDs from the references you got from the first call. That will also allow you to load the details dynamically and in small batches which will result in a more responsive UI.
See:
https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/list?view=azure-devops-rest-4.1

Can we do simultaneous multiple operations in Redis like a Stored Procedure

I have a User's information which I have stored in a Hash. I have his permission information stored in a Set.
I want to test for a condition on the Set, retrieve the Key and then fetch the actual Value using the retrieved Key from the Hash.
How can I do this?
Do I have to use Lua scripting to achieve the above goal or is there any other way?
You'll have to do it using multiple requests in that case. While Lua appears to be the way, your requirements - namely fetch a key based on the value of another key - rule out a single script since key names should be passed explicitly.
I had the same requirement and I couldn't find any other way to do this. Redis pipeline and transaction functions are other tools to execute multiple commands in single step but for your situation where you want to get a value and execute a command based on it, the only way remains is LUA!!
you can use a hash to handle user information and his permissions (in the same hash). In this case, when you have a userId you can retrieve the permissions with one shot by using userId and permissionKey. See example below, I put the permissions as string (in your case put it as Set):
redis> HSET userId permissionKey "perm1, perm2, perm3"
redis> HGET userId permissionKey
"perm1, perm2, perm3"
Hope this help you.

Getting Asana Task sort order via API

I am trying to get the sort order associated with of within a project. I don't see a field with info in it. When I get the tasks can I assume that order the tasks are in the json is the sort order in the Project? It looks like it that is the case, I just would like confirmation.
Thanks
Randy
When we return the tasks associated with a project we return them in "project priority" order - as in, the order they've been put into manually. If you change the view in the app (say, to sort by hearted) they'll still be in the manual order when fetched via the API.

Resources