- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 02:10 PM
I have a requirement to create an approval from a task.
We want that when someone requests an application for our app store, that it be vetted first by the Mobility Support team. Once Vetted, if accepted the tech will click on submit for approval (closed complete) an approval will go to the Mobility Support Manager. Upon his approval it will revert back to the Mobility support team to retrieve the application and place it in the app store.
If not accepted by the Mobility Support Team, in the initial stage, the tech will click Invalid Request (closed incomplete) and the workflow will cancel out there.
My issue is at the beginning. The task is being created from the initial request, but once it hits the if statement, (if closed complete create approval) everything starts to whack out. Depending on how I place the values either Submit for approval.
I have done the following.
Flowed directly from the SCTask to the Approval - Fail
Invalid request closed task as Closed Incomplete but created Approval - this is incorrect
Submit for approval closed complete task, created approval - this is correct
Flowed directly from SCTASK to If Condition from if condition to set values (rejection) - Fail
Invalid Request Cancelled the work flow, and set state to closed incomplete. did not create approval - correct
Submit for approval Cancelled the work flow, and set state to closed incomplete. did not create approval - incorrect
Flow from ScTask to Wait for condition, (if state is not one of - Pending, Opened, work in progress) - to if condition (state is closed complete)( - yes to approval, no to rejection) - fail
Invalid Request Cancelled the work flow, and set state to closed incomplete. did not create approval - correct
Submit for approval Cancelled the work flow, and set state to closed incomplete. did not create approval - incorrecta
I really need assistance in setting up script or someone telling me the if statement is not working properly. Below I have attached the workflow as I have it now which is still not functioning properly
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 02:57 PM
Following up with screenshots. Once you add the new conditions your workflow will look something like this:
I just renamed "Always" to Approved and set a condition. It looks like this:
Then I right clicked on the Catalog task and added a new Condition, named it Rejected and added a condition:
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 02:35 PM
Can you post a screenshot of your If conditions or script?
And I am not sure of the purpose of the Wait for Condition in the workflow as well. Can you explain?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 02:50 PM
I believe your issue is that you need the state of the Catalog Task to base your IF condition on. The workflow executes in the sc_req_item table and the catalog tasks are stored in the sc_task table which is creating your issue.
When a child task is closed, the activity.result value is set to the State of the task at the time of closure. So what I would suggest is add additional conditions to your Catalog task activity so you can branch from there. To do this, right click on the activity and select "Add Condition". Name it to something like "Closed Complete" and then the condition would be activity.result == '3', add another for "Closed Incomplete" and the condition would be activity.result == '4' and so on. If you really only care about Closed Complete, you could just rename the "Always" condition (double-click on the yellow always to edit it) to something like Rejected and make its condition activity.result != '3'
Then you can branch from that activity to create the approval or set the value to rejection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2016 02:57 PM
Following up with screenshots. Once you add the new conditions your workflow will look something like this:
I just renamed "Always" to Approved and set a condition. It looks like this:
Then I right clicked on the Catalog task and added a new Condition, named it Rejected and added a condition:
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2016 05:52 AM
Michael,
Sorry for the late reply. I copied exactly how you instructed, had my fingers crossed the whole time and thankfully, this was the result that I needed. Thank you so much for assisting me.