I am trying to call subsequent task once the timer's is over via y timer API call. Per the doc, I have to similar formated code:
timer_request = {
"duration": "PT10S",
"timerLabel": "My Task Timer",
"creationBehavior": {
"displayExperience": {
"visibility": "VISIBLE"
}
},
"triggeringBehavior": {
"operation": {
"type": "LAUNCH_TASK",
"textToConfirm": [{
"locale": "en-US",
"text": "Timer elapsed. Would you like to launch {continueWithSkillName}?"
}],
"task": {
"name": "CountDown",
"version": "1",
}
},
"notificationConfig": {
"playAudible": True
}
}
}
However, as soon as, I change the {continueWithSkillName}to any other name or simply take the brackets out, I run into bad request error. Does anybody why or what shall I do?
If you read farther down in the docs you linked, it says it's mandatory.
** {continueWithSkillName} is mandatory somewhere. This is replaced with "continue with ". **
While it appears you can move it within the string where it appears, it must be part of the string.
Related
I want to change the status of the project issue on Jira. The status is Open and I want to make it Fixed. My url is PUT https://jiradbg-sandbox.deutsche-boerse.de/rest/api/latest/issue/PID-XX
{
"update": {
"fields":{
"status": [
{
"set": "Fixed"
}
]
}
}
}
and the response is:
{
"errorMessages": ["Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: org.apache.catalina.connector.CoyoteInputStream#5de98556; line: 3, column: 9]
(through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])"]
}
There are two problems that you are encountering here.
The first problem is update or fields should be provided separately to Jira's edit issue API, not one inside of the other. They have equivalent functionality so normally only one is used. For example to update the summary field provide either update:
{
"update": {
"summary": [
{
"set": "Updated by update"
}
]
}
}
or fields:
{
"fields": {
"summary": "Summary set by fields"
}
}
However the status field is a special case and can't be updated directly, which is the second problem here. Changing a status in Jira is called a transition. You need to trigger the transition to move the issue into the status you want.
Start by identifying the available transitions by calling the get transitions API:
GET https://example.net/rest/api/latest/issue/PID-XX/transitions
This tells you which transitions are currently available, something like this:
{
"expand": "transitions",
"transitions": [
{
"id": "21",
"name": "Fixed",
"to": {
"self": "https://example.net/rest/api/2/status/10001",
"description": "",
"iconUrl": "https://example.net/images/icons/status_generic.gif",
"name": "Fixed",
"id": "10001",
"statusCategory": {
"self": "https://example.net/rest/api/2/statuscategory/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
}
}
]
}
Take the id of the transition you want, in this case 21, then post it to the issue transition API:
POST https://example.net/rest/api/latest/issue/PID-XX/transitions
Use a request body like this:
{
"transition": {
"id": 21
}
}
You should get a 204 HTTP response from Jira which indicates the transition was successful.
We are getting an error while executing a WorkItem in Forge's Design Automation API.
The error is this:
Error: The category 'rfaFile' in '$(rfaFile)' is unrecognized. Valid values are args, settings, appbundles, engine, engines.
And it happens right after the 'Start preparing script and command line parameters.' in the report.txt. We are not really sure why's this happening. It looks like the error is thrown in the activity. The activity looks like this:
function publishActivity() {
return $.ajax({
url: "/api/forge/design_automation/activities",
headers: {
"X-CSRF-Token": csrfToken,
"Forge-Token": forgeToken
},
method: "POST",
contentType: "application/json",
data: JSON.stringify({
activity: {
"id": "DeleteWallsActivity",
"commandLine": [ "$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rfaFile].path)\" /al \"$(appbundles[TestAppId].path)\"" ],
"parameters": {
"rfaFile": {
"zip": false,
"ondemand": false,
"verb": "get",
"description": "Input Revit model",
"required": true,
"localName": "$(rfaFile)"
},
"result": {
"zip": false,
"ondemand": false,
"verb": "put",
"description": "Results",
"required": true,
"localName": "result.rfa"
},
"inputJson": {
"verb": "get",
"description": "input json",
"localName": "params.json",
"ondemand": false,
"required": false,
"zip": false
}
},
"engine": "Autodesk.Revit+2021",
"appbundles": [ "petar3db.TestAppId+test" ],
"description": "Deletes walls from Revit file."
}
})
}).done(function(data) {
console.log("Activity created");
bundleUploadData = data["uploadParameters"];
}).fail(function(jqXHR, textStatus) {
console.log("Failed to create activity", jqXHR.responseJSON);
console.log(jqXHR, textStatus);
});
}
and it looks like the "localName": "$(rfaFile)" is causing the trouble.
Let's take a look at our WorkItem code which we execute via websockets:
{
"headers": {
"Authorization" : "Bearer <token here>"
},
"action": "post-workitem",
"data": {
"activityId": "petar3db.DeleteWallsActivity+test",
"arguments": {
"rfaFile": {"url": "https://developer.api.autodesk.com/oss/v2/signedresources/da992c60-a3d7-469d-8c3e-d0f089e2e509?region=US", "pathInZip": "emptyfam.rfa"},
"result": {"verb": "put", "url": "https://developer.api.autodesk.com/oss/v2/signedresources/b78151c1-93aa-495f-96c8-183bca26e071?region=US"},
"inputJson": {"localName": "params.json", "url": "the url to the file"}
}
}
}
the really strange part is that this process worked just fine and started throwing this error when we added "inputJson" into the activity and workItem. (We want to send some JSON data to the AppBundle with the WorkItem)
What can be the issue? Are missing something?
As for "localName": "$(rfaFile)", to be noted that if the local name is defined like this, Design Automation will come up a valid name for this argument by its own logic. If you want to fully control the input file, such as accessing it in the addin(Appbundles)'s code, it is recommended to define a "real" localName instead, e.g. "localName": "input.rfa"
In your case above, you may need to:
Remove /i \"$(args[rfaFile].path)\" from commandLine in the Activity
Define "localName": "inputRFA", so the input will be downloaded, unzipped as a folder named as inputRFA. emptyfam.rfa should be under this folder.
Call OpenDocumentFile in the addin to open a Revit file, get document
Call document.LoadFamily(".\inputRFA\emptyfam.rfa", out family); in the adding to open/load rfa file. See this Revit API
There is a mismatch in parameter name in activity with the argument name in workitem. Correct way to post the workitem should be:
{
"headers": {
"Authorization" : "Bearer <token here>"
},
"action": "post-workitem",
"data": {
"activityId": "petar3db.DeleteWallsActivity+test",
"arguments": {
"rfaFile": {"url": "https://developer.api.autodesk.com/oss/v2/signedresources/da992c60-a3d7-469d-8c3e-d0f089e2e509?region=US", "pathInZip": "emptyfam.rfa"},
"result": {"verb": "put", "url": "https://developer.api.autodesk.com/oss/v2/signedresources/b78151c1-93aa-495f-96c8-183bca26e071?region=US"},
"inputJson": {"localName": "params.json", "url": "the url to the file"}
}
}
}
Change the argument field rvtFile to rfaFile.
Very simple issue. I am trying to set up a pipeline that has a variable of type bool. As soon as I add it, the pipeline fails with:
{
"code":"BadRequest",
"message":"Invalid value for property 'type'",
"target":"pipeline/pipeline2/runid/66b9c7be-9894-494a-abd9-34fd92bbd972",
"details":null,
"error":null
}
simple pipeline with a string variable and a wait activity succeeds.
{
"name": "pipeline2",
"properties": {
"activities": [
{
"name": "Wait1",
"type": "Wait",
"typeProperties": {
"waitTimeInSeconds": 1
}
}
],
"variables": {
"Test": {
"type": "String",
"defaultValue": "\"Hello\""
}
}
}
}
When I add a bool and nothing else, it fails to debug.
{
"name": "pipeline2",
"properties": {
"activities": [
{
"name": "Wait1",
"type": "Wait",
"typeProperties": {
"waitTimeInSeconds": 1
}
}
],
"variables": {
"Test": {
"type": "String",
"defaultValue": "\"Hello\""
},
"TestBool": {
"type": "Bool",
"defaultValue": false
}
}
}
}
Any clue how to get this to work? I am trying to use this variable as a condition for an Until loop.
Many thanks.
ok, I experimented.
If I go into the code and set the type as boolean rather than Bool, then the above pipeline runs.
Looks like a UI bug in the designer that sets the type to Bool. I'll file a bug report.
Mark.
Update ok it runs but I can't set a default value (it disappears) and anything that references the value causes an Internal Server Error (presumably because it is null which is invalid for a Boolean). Definitely something for the engineers to look at.
Update 2 It appears you can set the variable with SetVariable without error but it appears not to do anything. The value is always true in my test case.
Update 3 Microsoft has a fix coming next week.
I'm trying to add boolean status field to a document on MongoLabs but I get a syntax error on that particular field when I try to save.
The type specifier seems 8 sees good according to the docs, but I can't find any examples on defining a boolean field within a document.
I managed to pin down the error to the status field, as the document saves without this field added.
Can anyone advise on the correct BSON syntax for the boolean field?
This is the boolean field I've added:
"status": {
{"$type": 8 } : true
}
And the complete document for reference:
{
"_id": {
"$oid": "565c4a37e4b0ed4652848949"
},
"email": "jd#outlook.com",
"products": [
{
"productId": "0121",
"price": 12.5,
"description": "A generic muffin"
},
{
"productId": "0122",
"price": 13.5,
"description": "A generic coffee"
},
{
"productId": "0123",
"price": 14.5,
"description": "A generic tea"
}
],
"date": {
"$date": "2014-03-03T03:45:00.000Z"
},
"status": {
{"$type": 8 } : true
}
}
If you wondering how to define a Boolean in a model class of node.js. If you are using MongoDB.
shopOpenStatus: {
type:Boolean,
default:"false",
required:true
}
It took me 10 min to discover this.
In case anyone else had the same issue. The data stored on MongoLabs is JSON, which is then converted to BSON locally using the driver.
The correct format below is as follows:
{
"status": true
}
I just have the curios issue that the draw event isn't allways fired when I reload my table.
Here is my table init:
mCommissionTable = $("#CommissionTable").dataTable({ "bJQueryUI": false, "sDom": 'lfrtip', "columns": [ { "data": "CommissionId" }, { "data": "Description" }, { "data": "CommissionTypeDisplayName" }, { "data": "DivisionCode" }, { "data": "EmployeeName" }, { "data": "EmployeeNumber" }, { "data": "PeriodFrom" }, { "data": "PeriodTill" }, { "data": "ApprovalStatusDisplayName" }, { "data": "StatusDisplayName" }, { "data": "Comment" } ] });
Here is my Refresh:
function onButtonClickA() { mCommissionTable.fnReloadAjax("GridCommunication.aspx?do=GetCommission" + mFilter, RefreshSelectedRows); }
Here is the RefreshSelectedRows:
function RefreshSelectedRows() { alert('fired!'); }
So everything works fine, table will not be loaded until I click the button the first time, everystime I click the button the table will be loaded. But in fact the callback (RefreshSelectedRows) is not fired every time.
In the DataTables.js code I found the __reload-method in which the API register the callback-event one time, Line 7140:
if (callback) {
var api = new _Api(settings);
api.one('draw', function () {
callback(api.ajax.json());
});
}
When I track it to that with Visual Studio and set breakpoint the Api,one-command will be hit with 100%, so it is registerred. The callback isself (what only happens when the event is fired) get hit randomly. I can't reproduce it. it just happened. I click 20 times on the button, 15 times it is okay, 5 times not...
I tried to track it down, but as far as I can see in the _fnReDraw method, where the fnDraw is called and the draw event in triggered everything is okay...
So... bug?
Any ideas?
Found the bug!
It was an old IE Version!
As soon as I started it with IE9+ it works like charm!