Completing Task When doing API Call returns 404 assignment does not exists

Confluence User - 05 Apr, 2018

Hello All.

We are trying to do external forms for one step in the workflow, we are sending all of the needed data to that form and when we are trying to compkete the step by sending json api call to our server we always get : {"error":{"date":"Date","code":"404","message":"Assignment does not exist."}}. The way we are sending the call is 

function sendComplete(activity) {
  var url = "http://localhost:8080/jw/web/json/workflow/assignment/complete/";
  var options = {
    "method": "post",
    "payload": {
      "activityId": activity //the activityId that we receive when we send data to external form.
    }
  };
  UrlFetchApp.fetch(url, options);
}

We have allowed to receive api calls from anyone. We are using Joget Workflow v6. Any Help would be greatly appreciated.

 

forms;api

5


05 Apr, 2018
confluenceUser
confluenceUser

Hi, based on JSON API#web/json/workflow/assignment/complete/(*:activityId), the activityId is appended to the url? I am not sure how your UrlFetchApp handle it.

05 Apr, 2018
confluenceUser
confluenceUser

I believe it should work same way as any other POST request.

05 Apr, 2018
confluenceUser
confluenceUser

As panda suggested, try putting the activityId in the URL itself instead of the payload e.g. "http://localhost:8080/jw/web/json/workflow/assignment/complete/"; + activityId

05 Apr, 2018
confluenceUser
confluenceUser

I have tried this function sendComplete() { var url = "http://localhost:8080/jw/web/json/workflow/assignment/complete/"; + activityId; var options = { "method": "post", "contentType" : "application/json", "payload": { "activityId": activityId } }; UrlFetchApp.fetch(url, options); } with no luck. Could it be that the activity ID is getting messed up in mid way?

06 Apr, 2018
confluenceUser
confluenceUser

There is an extra semicolon in the var url line? Should be var url = "http://localhost:8080/jw/web/json/workflow/assignment/complete/"; + activityId;

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print