Forums

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

Mock Jira API Calls

Tim Ellis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2020

I have a service I wrote that depends on creating tickets in Jira.

Sometimes if someone changes the Jira project (or maybe Jira is down, or a million other possible problems), my service can no longer create Jiras or work with them. When that happens, my service is down.

I want to write monitoring that tests my service. Say it checks every 5 seconds if my service is working.

This means my service needs to create a new Jira ticket (and delete it so it doesn't pollute the Jira project) every 5 seconds. That's thousands of Jira tickets a day.

Question 1: can Jira do this just fine? If I create a new Jira and delete it every 5 seconds for years?

Question 2: assuming "no" (everyone here thinks it's "no"), how can I achieve this? Is there a Jira API call to do everything about creating a Jira in a project except the actual bit of creating the Jira? Like, test permissions, required custom fields are all filled in, etc?

Question 3: Can I setup a "dev" Jira project that my service could connect to, so it can pollute the project with all these test Jiras every 5 seconds?

Question 4: am I doing it wrong? Is there a better way to do this?

1 answer

0 votes
sukkeong
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.
February 19, 2020
  1. Ping if the server is alive and the service is up and running
  2. Call the REST API for the target project
    curl <options> <jira-url>:<port>/rest/api/2/project/{projectIdOrKey}

    • If the above returns a valid json file - OK

    • If the above returns a json with error message - project is not found

    • If an http error is returned - server is down

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events