Using PATCH API in Copy Data activity Sink fails with Path missing error

Mark Northcott 1 Reputation point
2022-11-05T14:22:43.217+00:00

Hello all,

I'm trying to feed some data back into Jira Align via REST API PATCH command after I have extracted via GET, and modified.
I can use PATCH command in JA using Swagger and Curl and the records will update.

However, if I setup as SINK in copy Data activity in Azure Data Factory (mapped to field $['description']), it always produces the following error:

Failure happened on 'Sink' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 400 BadRequest, please check your activity settings.

Request URL: https://xxxxx.jiraalign.com/rest/align/api/2/Risks/103.

Response: Cannot update risk with id 103. Value cannot be null. (Parameter 'path'),Source=Microsoft.DataTransfer.ClientLibrary,'

I have tried to make it as bare bones as possible, trying to update a simple field but I get the same error everytime. It doesn't matter which I am trying to update (Risk or Story) or the fields.

JSON (See Below) clearly shows where values are coming from in Source and a test of the query in source does show values returned in each cell.

Any advice would help as this is stumping me.

{
"name": "TEST_PATCH Raw JA",
"properties": {
"activities": [
{
"name": "Copy data1",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "AzureSqlSource",
"sqlReaderQuery": "Select [RiskID], [IRR New], [RRR New] From [ATSK].[RiskJiraAlign] Where [RiskID] =103",
"queryTimeout": "02:00:00",
"partitionOption": "None"
},
"sink": {
"type": "RestSink",
"httpRequestTimeout": "00:03:40",
"requestInterval": 10,
"requestMethod": "PATCH",
"writeBatchSize": 10000,
"httpCompressionType": "none"
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"mappings": [
{
"source": {
"name": "RiskID",
"type": "Int32"
},
"sink": {
"path": "$['id']"
}
},
{
"source": {
"name": "IRR New",
"type": "String"
},
"sink": {
"path": "$['description']"
}
}
]
}
},
"inputs": [
{
"referenceName": "ResourceSQLJiraAlignEI",
"type": "DatasetReference",
"parameters": {
"DynamicSchema": "ATSK",
"DynamicTable": "RiskJiraAlign"
}
}
],
"outputs": [
{
"referenceName": "TESTRestPatchRawJA",
"type": "DatasetReference"
}
]
}
],
"annotations": [],
"lastPublishTime": "2022-10-30T03:45:13Z"
},
"type": "Microsoft.DataFactory/factories/pipelines"
}

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,236 Reputation points
    2022-11-08T21:06:38.83+00:00

    Hello @Mark Northcott and welcome to Microsoft Q&A.

    The error says the issue is on the sink side of the Copy Activity. The 400 status code suggests jira doesn't like something about the request organization or format.

    Since JSON can be heirarchical, I'm wondering if the fields are not base level. That is, $something.description vs $description.
    I'm looking at the Atlassian Align docs Getting-started-with-the-REST-API-2-0 , but I haven't found any model called "Risk" nor anything about posting / patching data. Am I looking in the wrong place?

    I'm not positive this is the problem, but it is my best idea so far.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.