passing element in the jira rest api url

Amani Bhamidipalli 21 Reputation points
2021-07-15T07:29:34.617+00:00

Hi friends

I want to use the rest API to extract the sprints id’s bypassing the (board id) as a parameter in the azure data factory in linked services. Can anyone suggests to me what to pass as a base URL and how to pass the parameters for board id for the following URL?

actually, the way we are trying to pass is as base URL in linked services: https://jira.example.com/rest/agile/latest/board/{boardid}/sprint/

The parameter is passed as "boardid"
the following are the captures of the process followed by me. can you please check it out and suggest to me for an accurate process to overcome the errors.

114991-parameter-passing-in-linked-services.pngid" for the URL
114908-parameter-passing-in-connection.png
114927-parameter-passing-in-pipeline.png
114964-error-while-passing-the-above-url.png

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

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2021-07-19T22:41:31.04+00:00

    Hi @Amani Bhamidipalli ,

    Thanks for using Microsoft Q&A forum and posting your query.

    There are two ways you can pass the BoardId to the Jira rest API URL

    Option 1: You can add a parameter called BoardID in you REST linked service and add it in the Base URL and then map the BoardID value from pipeline parameter -> dataset parameter -> linked service parameter.

    Below is sample JSON payload of parameterized REST linked service. You can follow similar way.

    {  
        "name": "RestServiceLS_parameterized",  
        "type": "Microsoft.DataFactory/factories/linkedservices",  
        "properties": {  
            "parameters": {  
                "BoardID": {  
                    "type": "string"  
                }  
            },  
            "annotations": [],  
            "type": "RestService",  
            "typeProperties": {  
                "url": "https://jira.example.com/rest/agile/latest/board/@{linkedService().BoardID}/sprint/",  
                "enableServerCertificateValidation": false,  
                "authenticationType": "Basic",  
                "userName": "jirauser",  
                "encryptedCredential": "xxxxxxxxxxxxxxx"  
            }  
        }  
    }  
    

    Option 2: You can just have the base URL in linked service as https://jira.example.com/rest/agile/latest/board/ and then you can pass BoardID/sprint/ as Relative URL from dataset to linked service.
    Sample Base URL looks like below in linked service:

    116082-image.png

    First you will have a dataset parameter for BoardID then you will have to concatenate it by appending /sprint to form the relative URL.

    Sample JSON Payload for REST Dataset:

    {  
        "name": "RestResource2",  
        "properties": {  
            "linkedServiceName": {  
                "referenceName": "RestServiceLS_Jira",  
                "type": "LinkedServiceReference"  
            },  
            "parameters": {  
                "BoardID": {  
                    "type": "string"  
                }  
            },  
            "annotations": [],  
            "type": "RestResource",  
            "typeProperties": {  
                "relativeUrl": {  
                    "value": "@concat(dataset().BoardID,'/sprint/')",  
                    "type": "Expression"  
                }  
            },  
            "schema": []  
        }  
    }  
    

    116035-image.png

    Hope this info helps. Do let us know if you have further query.

    ----------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.


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.