Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Create a record using API via VBA

Gustavo Miller September 19, 2021

Is there a way to create a JIRA record using API (post) via VBA??

Perhaps a sample would be great!

1 answer

0 votes
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 19, 2021

@Gustavo Miller this is for sure possible.

As sample you take some inspiration from this post - https://ashuvba.blogspot.com/2014/08/excel-vba-json-rest-with-jira-json-is.html

 

Also, if you can find better library for VBA to call rest api you can use that as well. Documented here - https://medium.com/automation-generation/using-vba-and-excel-to-make-authenticated-requests-for-alpacas-trading-api-2968acaa3776

Gustavo Miller September 22, 2021

Sorry for the tardiness, it is been very busy at work. I will look at this.

Gustavo Miller September 27, 2021

DPK J, I was wondering if you can share a sample of a JSON string. Due to the number of double-quotes, building the string can be quite challenging.

This is what I gather from the samples:

{“fields” :
      {
           “project” : { “key” : “@KEY@” } ,
          “issuetype” : { “name” : “@IssueType@” }
      }
}

I am assuming that the 'at' signs at NOT part of the string; guess in there I replace with my data. If you can help I would appreciate very much.

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2021

Here is sample curl that I use

curl --request POST \
--url 'https://<DOMAIN>.atlassian.net/rest/api/3/issue' \
--user '<YOUR_EMAIL>:<API_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"summary": "Issue summary",
"issuetype": {
"id": "10000"
},
"project": {
"id": "10000"
}
}
}'

 

On data, sure you need to replace `@`, and data itself is JSON string. So for this you can use any library that has 'stringify' function. For example this - https://github.com/VBA-tools/VBA-JSON

Here you create dictionary and collection and then convert that to json string, which is much more easier than directly writing json string.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events