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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,461,658
Community Members
 
Community Events
176
Community Groups

Create a record using API via VBA

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 Sep 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

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

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 Sep 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

Atlassian Community Events