Azure Logic应用程序条件步骤无法正常工作

n3schb8v  于 12个月前  发布在  其他
关注(0)|答案(2)|浏览(127)

我想做自动化,当任何人改变 * 子任务状态为'进行中'他们的父,即。产品待办事项状态在azure板中自动更新为'Committed'。*
为了实现这一点,尝试创建逻辑应用程序,但每次运行条件时,都会跳过状态“分支条件不满足”。
我的逻辑应用程序设计器如下所示

以下是我在逻辑应用程序中使用的步骤。

条件为任务状态正在进行且父级等于New

当条件为真时,则在当前未运行的步骤下运行

错误am面临如下

以下是使用

的PBI的条件下拉参考

nbysray5

nbysray51#

在这里,如果子任务的状态更改为Done,我将尝试从Doing to Done更新父任务的状态。
为了实现这一点,尝试创建逻辑应用程序,但每次运行条件时,都会跳过状态“分支条件不满足”。
请验证您的条件是否为真,即使我的条件执行为假时也会出现同样的错误。

或者验证System.State: Committed在您的工作项中是否可用。

工作流程:

检查父级的状态为“正在执行”而子级的状态为“完成”时,它将返回true。

输出:

我的工作流正在成功执行,状态已更改为“完成”。

请检查条件操作中的两个字段是否正确填充并以真实状态执行。

2mbi3lxu

2mbi3lxu2#

昨天我创建了与您相同的工作流程,然后遇到了与您相同的问题。Condition的“expressionResult”始终为false。有趣的是,我今天用同样的操作创建了一个新的工作流程,它工作了。与你分享我的代码,你可以与你的比较,看看是否有任何差异。

{
    "definition": {
        "$schema": "...",
        "actions": {
            "Condition": {
                "actions": {
                    "Update_a_work_item": {
                        "inputs": {
                            "body": {
                                "userEnteredFields": {
                                    "System.State": "Committed"
                                }
                            },
                            "host": {
                                "connection": {
                                    "referenceName": "visualstudioteamservices"
                                }
                            },
                            "method": "patch",
                            "path": "/_apis/wit/workitems/@{encodeURIComponent(body('Get_work_item_details')?['id'])}",
                            "queries": {
                                "account": "{org name}"
                            }
                        },
                        "type": "ApiConnection"
                    }
                },
                "else": {
                    "actions": {}
                },
                "expression": {
                    "and": [
                        {
                            "equals": [
                                "@triggerBody()?['fields']?['System_State']",
                                "In Progress"
                            ]
                        },
                        {
                            "equals": [
                                "@body('Get_work_item_details')?['fields']?['System_State']",
                                "New"
                            ]
                        }
                    ]
                },
                "runAfter": {
                    "Get_work_item_details": [
                        "SUCCEEDED"
                    ]
                },
                "type": "If"
            },
            "Get_work_item_details": {
                "inputs": {
                    "host": {
                        "connection": {
                            "referenceName": "visualstudioteamservices"
                        }
                    },
                    "method": "get",
                    "path": "/_apis/wit/workitems/@{encodeURIComponent(triggerBody()?['fields']?['System_Parent'])}",
                    "queries": {
                        "account": "{org name}",
                        "project": "{project name}",
                        "typeName": "Product Backlog Item"
                    }
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_a_work_item_is_updated": {
                "inputs": {
                    "host": {
                        "connection": {
                            "referenceName": "visualstudioteamservices"
                        }
                    },
                    "method": "get",
                    "path": "/v2/workitemupdated_trigger/@{encodeURIComponent('{project name}')}/_apis/wit/wiql",
                    "queries": {
                        "account": "{org name}",
                        "wiql__System_WorkItemType": "Task"
                    }
                },
                "recurrence": {
                    "frequency": "Minute",
                    "interval": 3
                },
                "splitOn": "@triggerBody()?['value']",
                "type": "ApiConnection"
            }
        }
    },
    "kind": "Stateful"
}

相关问题