How to create an issue automatically in JIRA without Jelly ?

Heiko Klump July 14, 2015

Today it's easy to create an issue automatically in JIRA.

A crontab controlled Bash-Script writes the jelly-code every day.  For example like this

 

<!-- Start -->
<JiraJelly  xmlns:jira="jelly:com.atlassian.jira.jelly.JiraTagLib">
<jira:CreateIssue
project-key="PCI"
issueType="Aufgabe"
assignee=ich
summary="PCI-Pruefung 10.6 Review logs fuer Gruppe ipsadm am 14.07.2015"
priority="Normal"
description="Review logs for all system components at least daily. "
duedate="21/Jul/15"
reporter="klumph">
</jira:CreateIssue>
</JiraJelly>
<!-- End -->

 

The Jelly-Service in JIRA is enabled and every day the issues are created.
Without Jelly i found no way to do that in such an easy manner. I know there is "Script Runner" but i found no solution for my problem.  Im not a programmer. Can anyone give me a tip ? Thanks in advance.

Heiko

2 answers

1 vote
Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 15, 2015

Doing this by a script is one thing. If you want to schedule creation of an issue from the UI you can check this plugin - https://marketplace.atlassian.com/plugins/pl.com.tt.jira.plugin.theschedulerpro . Maybe this is what you are looking for with a little better user friendly UI.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 14, 2015

As you mention you've got a bash script that runs to create this jelly script, I'd reuse that.

Instead of updating the jelly, I'd use it to create the issue over REST, probably by using curl in the script!

See https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue for the curl you'll need (I think you'll see how to translate the Jelly above into JSON for the curl command)

Heiko Klump July 15, 2015

Wow, thank you very much.
This solution is easy like jelly wink . Great.
For other customers with the same problem. Here is my example curl

"curl -D- -k -u klumph:mypassword -X POST --data @/opt/jira/data.txt -H "Content-Type: application/json" https://jira.test.server/jira/rest/api/2/issue/" <-- one string 

with /opt/jira/data.txt

{     
    "fields": {
       "project":
       {
          "key": "PCI"
       },
       "summary": "PCI-Pruefung 10.6 Review logs fuer Gruppe ipsadm am 15.07.2015",
       "assignee":
       {
          "name": "ich"
       },
       "duedate": "2015-07-21",
       "description": "Review logs for all system components at least daily.",
       "issuetype":
       {
          "name": "Aufgabe"       
       }   
   }
}

 

Heiko

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 15, 2015

Neat translation example, that'll help a lot of people trying to convert! Thanks!

Suggest an answer

Log in or Sign up to answer