Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create JSON packet dynamically for issue creation

Rajeev Ranjan July 6, 2018

I am new user for JIRA. I am building a Test Automation application and which will have capabilities to add defect/issue in JIRA in case test automation fails. I have multiple clients and each having different JIRA configuration with different set of custom fields. I want to build a capabilities in my application where I can create issue creation REST packet dynamically based on client JIRA environment. I am facing challenge because some fields take input in value, some take input in name. some take value inside {...}, some take [{....}] etc. 

Can you please help me to understand how I can prepare JSON packet dynamically if user provides all required input fields details?

i.e.

  • "customfield_10512": [{
    "value": "No"
    }],
  • "priority": {
    "name": "Medium"
    },
  • "customfield_10411": [{
    "value": "Bank - IT"
    }]
  • "summary": "Sample UTS ten test",

1 answer

0 votes
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2018

Hi Rajeev

If you look at this document you'll see that you can query the metadata, which will be specific to each Jira instance. You will then know what format is required

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events