We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a logic app standard workflow:
Create a HTTP request triger that trigers on Devops US updates (webhook)
Create a Post card in a chat or channel connector
{ "type": "ApiConnection", "inputs": { "host": { "connection": { "referenceName": "teams-1" } }, "method": "post", "body": { "recipient": { "groupId": "@{appsetting('sst626_teamId')}", "channelId": "@{appsetting('sst626_channelId')}" }, "messageBody": "@variables('AdaptiveCard')" }, "path": "/v1.0/teams/conversation/adaptivecard/poster/@{encodeURIComponent('User')}/location/@{encodeURIComponent('Channel')}", "retryPolicy": { "type": "exponential", "count": 30, "interval": "PT30S", "minimumInterval": "PT10S", "maximumInterval": "PT15M" } }, "runAfter": { "Switch": [ "Succeeded" ] }, "limit": { "timeout": "PT8M" } }
PreconditionFailed-ETag mismatch for thread resource
Standard (Portal)
Windows
New Designer
Yes
{ "definition": { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "actions": { "Init_workitemeditlink": { "type": "InitializeVariable", "inputs": { "variables": [ { "name": "WorkItemEditLink", "type": "string" } ] }, "runAfter": {} }, "init_adaptive_card": { "type": "InitializeVariable", "inputs": { "variables": [ { "name": "AdaptiveCard", "type": "string" } ] }, "runAfter": { "Init_workitemeditlink": [ "SUCCEEDED" ] } }, "Post_card_in_a_chat_or_channel": { "type": "ApiConnection", "inputs": { "host": { "connection": { "referenceName": "teams-1" } }, "method": "post", "body": { "recipient": { "groupId": "@{appsetting('sst626_teamId')}", "channelId": "@{appsetting('sst626_channelId')}" }, "messageBody": "@variables('AdaptiveCard')" }, "path": "/v1.0/teams/conversation/adaptivecard/poster/@{encodeURIComponent('User')}/location/@{encodeURIComponent('Channel')}", "retryPolicy": { "type": "exponential", "count": 30, "interval": "PT30S", "minimumInterval": "PT10S", "maximumInterval": "PT15M" } }, "runAfter": { "Switch": [ "SUCCEEDED" ] }, "limit": { "timeout": "PT8M" } }, "Switch": { "type": "Switch", "expression": "@triggerBody()?['eventType']", "default": { "actions": { "Set_variable_undefined_type": { "type": "SetVariable", "inputs": { "name": "AdaptiveCard", "value": "{\n \"type\": \"AdaptiveCard\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"🚩 Notification from Azure DevOps\",\n \"spacing\": \"Medium\",\n \"size\": \"Large\",\n \"weight\": \"Bolder\"\n },\n {\n \"type\": \"TextBlock\",\n \"text\": \"@{triggerBody()?['message']?['text']}\",\n \"size\": \"Medium\",\n \"spacing\": \"None\"\n },\n {\n \"type\": \"FactSet\",\n \"facts\": [\n {\n \"title\": \"Title\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.Title']}\"\n },\n {\n \"title\": \"Type\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.WorkItemType']}\"\n },\n {\n \"title\": \"Assigned to\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.AssignedTo']}\"\n },\n {\n \"title\": \"Created time (UTC)\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.CreatedDate']}\"\n }\n ]\n },\n {\n \"type\": \"ActionSet\",\n \"actions\": [\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"View work item\",\n \"url\": \"@{variables('WorkItemEditLink')}\"\n }\n ]\n }\n ],\n \"version\": \"1.2\",\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\"\n}" } } } }, "cases": { "Case_deleted": { "actions": { "Set_card_deleted": { "type": "SetVariable", "inputs": { "name": "AdaptiveCard", "value": "{\n \"type\": \"AdaptiveCard\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"🚩 Notification from Azure DevOps\",\n \"spacing\": \"Medium\",\n \"size\": \"Large\",\n \"weight\": \"Bolder\"\n },\n {\n \"type\": \"TextBlock\",\n \"text\": \"@{json(outputs('Execute_JavaScript_Code-del'))[0]['textValRes']}\",\n \"size\": \"Medium\",\n \"spacing\": \"None\"\n },\n {\n \"type\": \"FactSet\",\n \"facts\": [\n {\n \"title\": \"Title\",\n \"value\": \"@{json(outputs('Execute_JavaScript_Code-del'))[1]['titleValRes']}\"\n },\n{\n \"title\": \"Action\",\n \"value\": \"@{replace(triggerBody()['eventType'],'.',' ')}\"\n },\n {\n \"title\": \"Type\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.WorkItemType']}\"\n },\n {\n \"title\": \"Assigned to\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.AssignedTo']}\"\n },\n {\n \"title\": \"Created time (UTC)\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.CreatedDate']}\"\n }\n ]\n },\n {\n \"type\": \"ActionSet\",\n \"actions\": [\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"View work item\",\n \"url\": \"@{variables('WorkItemEditLink')}\"\n }\n ]\n }\n ],\n \"version\": \"1.2\",\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\"\n}" }, "runAfter": { "Execute_JavaScript_Code-del": [ "SUCCEEDED" ] } }, "Set_edit_link_del": { "type": "SetVariable", "inputs": { "name": "WorkItemEditLink", "value": "@concat('https://dev.azure.com/myorg/',triggerBody()?['resource']?['fields']?['System.TeamProject'],'/_workitems/edit/',triggerBody()?['resource']['id'])" } }, "Compose_text_val_d": { "type": "Compose", "inputs": "@triggerBody()?['message']?['text']", "runAfter": { "Set_edit_link_del": [ "SUCCEEDED" ] } }, "Compose__title_d": { "type": "Compose", "inputs": "@triggerBody()?['resource']?['fields']?['System.Title']", "runAfter": { "Compose_text_val_d": [ "SUCCEEDED" ] } }, "Execute_JavaScript_Code-del": { "type": "JavaScriptCode", "inputs": { "code": "let textVal=workflowContext.actions.Compose_text_val_d.outputs\r\nlet titleVal=workflowContext.actions.Compose__title_d.outputs\r\n\r\nlet textValRes=textVal.replace(/\\\\/g, '\\\\');\r\n textValRes=textValRes.replace(/\"/g, '');\r\n textValRes=textValRes.split(\"(https:\")[0].trim();\r\n \r\nlet titleValRes= titleVal.replace(/\"/g, '');\r\n titleValRes= titleValRes.replace(/\\\\/g, '\\\\');\r\n\r\nconst result = JSON.stringify([\r\n {textValRes: textValRes},\r\n {titleValRes: titleValRes},\r\n]);\r\n\r\nreturn result;" }, "runAfter": { "Compose__title_d": [ "SUCCEEDED" ] } } }, "case": "workitem.deleted" }, "Case_created": { "actions": { "Set_card_created": { "type": "SetVariable", "inputs": { "name": "AdaptiveCard", "value": "{\n \"type\": \"AdaptiveCard\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"🚩 Notification from Azure DevOps\",\n \"spacing\": \"Medium\",\n \"size\": \"Large\",\n \"weight\": \"Bolder\"\n },\n {\n \"type\": \"TextBlock\",\n \"text\": \"@{json(outputs('Execute_JavaScript_Code-creat'))[0]['textValRes']}\",\n \"size\": \"Medium\",\n \"spacing\": \"None\"\n },\n {\n \"type\": \"FactSet\",\n \"facts\": [\n {\n \"title\": \"Title\",\n \"value\": \"@{json(outputs('Execute_JavaScript_Code-creat'))[1]['titleValRes']}\"\n },\n{\n \"title\": \"Action\",\n \"value\": \"@{replace(triggerBody()['eventType'],'.',' ')}\"\n },\n {\n \"title\": \"Type\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.WorkItemType']}\"\n },\n {\n \"title\": \"Assigned to\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.AssignedTo']}\"\n },\n {\n \"title\": \"Created time (UTC)\",\n \"value\": \"@{triggerBody()?['resource']?['fields']?['System.CreatedDate']}\"\n }\n ]\n },\n {\n \"type\": \"ActionSet\",\n \"actions\": [\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"View work item\",\n \"url\": \"@{variables('WorkItemEditLink')}\"\n }\n ]\n }\n ],\n \"version\": \"1.2\",\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\"\n}" }, "runAfter": { "Execute_JavaScript_Code-creat": [ "SUCCEEDED" ] } }, "Set_edit_link_cre": { "type": "SetVariable", "inputs": { "name": "WorkItemEditLink", "value": "@concat('https://dev.azure.com/myorg/',triggerBody()?['resource']?['fields']?['System.TeamProject'],'/_workitems/edit/',triggerBody()?['resource']['id'])" } }, "Execute_JavaScript_Code-creat": { "type": "JavaScriptCode", "inputs": { "code": "let textVal=workflowContext.actions.Compose_text_val_c.outputs\r\nlet titleVal=workflowContext.actions.Compose__title_c.outputs\r\n\r\nlet textValRes=textVal.replace(/\\\\/g, '\\\\');\r\n textValRes=textValRes.replace(/\"/g, '');\r\n textValRes=textValRes.split(\"(https:\")[0].trim();\r\n \r\nlet titleValRes= titleVal.replace(/\"/g, '');\r\n titleValRes= titleValRes.replace(/\\\\/g, '\\\\');\r\n\r\nconst result = JSON.stringify([\r\n {textValRes: textValRes},\r\n {titleValRes: titleValRes},\r\n]);\r\n\r\nreturn result;" }, "runAfter": { "Compose__title_c": [ "SUCCEEDED" ] } }, "Compose_text_val_c": { "type": "Compose", "inputs": "@triggerBody()?['message']?['text']", "runAfter": { "Set_edit_link_cre": [ "SUCCEEDED" ] } }, "Compose__title_c": { "type": "Compose", "inputs": "@triggerBody()?['resource']?['fields']?['System.Title']", "runAfter": { "Compose_text_val_c": [ "SUCCEEDED" ] } } }, "case": "workitem.created" }, "Case_updated": { "actions": { "Set_card_updated": { "type": "SetVariable", "inputs": { "name": "AdaptiveCard", "value": "{\n \"type\": \"AdaptiveCard\",\n \"body\": [\n {\n \"type\": \"TextBlock\",\n \"text\": \"🚩 Notification from Azure DevOps\",\n \"spacing\": \"Medium\",\n \"size\": \"Large\",\n \"weight\": \"Bolder\"\n },\n {\n \"type\": \"TextBlock\",\n \"text\": \"@{json(outputs('Execute_JavaScript_Code'))[0]['textValRes']}\",\n \"size\": \"Medium\",\n \"spacing\": \"None\"\n },\n {\n \"type\": \"FactSet\",\n \"facts\": [\n {\n \"title\": \"Title\",\n \"value\": \"@{json(outputs('Execute_JavaScript_Code'))[1]['titleValRes']}\"\n },\n{\n \"title\": \"Action\",\n \"value\": \"@{replace(triggerBody()['eventType'],'.',' ')}\"\n },\n {\n \"title\": \"Type\",\n \"value\": \"@{triggerBody()?['resource']?['revision']?['fields']?['System.WorkItemType']}\"\n },\n {\n \"title\": \"Assigned to\",\n \"value\": \"@{triggerBody()?['resource']?['revision']?['fields']?['System.AssignedTo']}\"\n },\n {\n \"title\": \"Created time (UTC)\",\n \"value\": \"@{triggerBody()?['resource']?['revision']?['fields']?['System.CreatedDate']}\"\n }\n ]\n },\n {\n \"type\": \"ActionSet\",\n \"actions\": [\n {\n \"type\": \"Action.OpenUrl\",\n \"title\": \"View work item\",\n \"url\": \"@{variables('WorkItemEditLink')}\"\n }\n ]\n }\n ],\n \"version\": \"1.2\",\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\"\n}" }, "runAfter": { "Execute_JavaScript_Code": [ "SUCCEEDED" ] } }, "Set_edit_link_upd": { "type": "SetVariable", "inputs": { "name": "WorkItemEditLink", "value": "@concat('https://myorg/',triggerBody()?['resource']?['fields']?['System.TeamProject'],'/_workitems/edit/',triggerBody()?['resource']['workItemId'])" } }, "Execute_JavaScript_Code": { "type": "JavaScriptCode", "inputs": { "code": "let textVal=workflowContext.actions.Compose_text_val.outputs\r\nlet titleVal=workflowContext.actions.Compose__title.outputs\r\n\r\nlet textValRes=textVal.replace(/\\\\/g, '\\\\');\r\n textValRes=textValRes.replace(/\"/g, '');\r\n textValRes=textValRes.split(\"(https:\")[0].trim();\r\n\r\nlet titleValRes= titleVal.replace(/\"/g, '');\r\n titleValRes= titleValRes.replace(/\\\\/g, '\\\\');\r\n\r\nconst result = JSON.stringify([\r\n {textValRes: textValRes},\r\n {titleValRes: titleValRes},\r\n]);\r\n\r\nreturn result;" }, "runAfter": { "Compose__title": [ "SUCCEEDED" ] } }, "Compose_text_val": { "type": "Compose", "inputs": "@triggerBody()?['message']?['text']", "runAfter": { "if_fo": [ "SUCCEEDED" ] } }, "Compose__title": { "type": "Compose", "inputs": "@triggerBody()?['resource']?['revision']?['fields']?['System.Title']", "runAfter": { "Compose_text_val": [ "SUCCEEDED" ] } }, "if_fo": { "type": "If", "description": "sometimes the theam pr. name is under a additional property (newValue)", "expression": { "and": [ { "contains": [ "@variables('WorkItemEditLink')", "newValue" ] } ] }, "actions": { "Set_clean_up_link": { "type": "SetVariable", "inputs": { "name": "WorkItemEditLink", "value": "@outputs('Compose_clean_up2')" }, "runAfter": { "Compose_clean_up2": [ "SUCCEEDED" ] } }, "Compose_cleanup1": { "type": "Compose", "inputs": "@replace(variables('WorkItemEditLink'),'{\"newValue\":\"','')" }, "Compose_clean_up2": { "type": "Compose", "inputs": "@replace(outputs('Compose_cleanup1'),'\"}','')", "runAfter": { "Compose_cleanup1": [ "SUCCEEDED" ] } } }, "else": { "actions": {} }, "runAfter": { "Set_edit_link_upd": [ "SUCCEEDED" ] } } }, "case": "workitem.updated" } }, "runAfter": { "init_adaptive_card": [ "SUCCEEDED" ] } } }, "contentVersion": "1.0.0.0", "outputs": {}, "triggers": { "When_a_HTTP_request_is_received": { "type": "Request", "kind": "Http" } } }, "kind": "Stateful" }
Edge
Could this be a concurrency issue ?
The text was updated successfully, but these errors were encountered:
This issue is stale because it has been open for 45 days with no activity.
Sorry, something went wrong.
We have the same issue and currently have solved this with a check if this failed and make a retry. Then it works but this is not a nice solution
No branches or pull requests
Describe the Bug with repro steps
Create a logic app standard workflow:
Create a HTTP request triger that trigers on Devops US updates (webhook)
Create a Post card in a chat or channel connector
{ "type": "ApiConnection", "inputs": { "host": { "connection": { "referenceName": "teams-1" } }, "method": "post", "body": { "recipient": { "groupId": "@{appsetting('sst626_teamId')}", "channelId": "@{appsetting('sst626_channelId')}" }, "messageBody": "@variables('AdaptiveCard')" }, "path": "/v1.0/teams/conversation/adaptivecard/poster/@{encodeURIComponent('User')}/location/@{encodeURIComponent('Channel')}", "retryPolicy": { "type": "exponential", "count": 30, "interval": "PT30S", "minimumInterval": "PT10S", "maximumInterval": "PT15M" } }, "runAfter": { "Switch": [ "Succeeded" ] }, "limit": { "timeout": "PT8M" } }
PreconditionFailed-ETag mismatch for thread resource
What type of Logic App Is this happening in?
Standard (Portal)
Which operating system are you using?
Windows
Are you using new designer or old designer
New Designer
Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg
Yes
Workflow JSON
Screenshots or Videos
Browser
Edge
Additional context
Could this be a concurrency issue ?
The text was updated successfully, but these errors were encountered: