Trying to create Jira tickets from within Confluence (both server) using REST API
Asked by Frank Rentef:

Trying to create Jira tickets from within Confluence (bother server). Looking for literal baby steps on "How To". Everything I've found so far is written for mid level to advanced users.

Help Appreciated!

THNX


Answers:
author: Frank Rentef
body: Thank you for your response. My question should have been more specific.

I am familiar with that method.

The powers "at be" in this environment insist on using Jira REST API. To quote, "we do not want to see any evidence of Jira"... "All done through Confluence....".

Why, I not know. Not logical in my mind....have the tools, use them... but I digress.

I'm a middle weight with Jira/Confluence but as of yet unexposed to the REST API method.

Any help is appreciated.

THNX

comments: author: Mikael Sandberg
body: Okay, then take a look at this one [using direct HTML links](https://confluence.atlassian.com/jirakb/how-to-create-issues-using-direct-html-links-in-jira-server-159474.html) to create Jira issues in Confluence. And here is a link to some REST API examples for creating issues, [Performing issue operations](https://developer.atlassian.com/server/jira/platform/performing-issue-operations/). You may also want to check out the [Atlassian Developer Community](https://community.developer.atlassian.com)

Another option would be to to use the Issue collector, [here](https://community.atlassian.com/t5/Jira-questions/Embedding-the-JIRA-Collector-form-in-Confluence/qaq-p/287841) is an old post about embedding it in Confluence.


author: Frank Rentef
body: Thank you sir! Off to do some reading.


author: Frank Rentef
body: Has anyone a basic working example of the following? <https://wiki.vertuna.com/display/CONFIFORMS/Creating+Jira+issue+from+Confluence+with+ConfiForms>

I've keyed, copied and read triple times and cannot make this simple example work.

My problem seems to be the JASON code needed for the IFTTT section.

THNX


author: Alex Medved _ConfiForms_
body: What error do you get when attept to create a Jira issue from ConfiForms?


author: Frank Rentef
body: Thank you for your time. I've successfully created the Jira ticket using Confiforms from within Confluence using the Summary and Description fields making issue type = Story.

I've tried expanding to other fields, in this case "Assignee" and I'm getting the following error message

"com.atlassian.sal.api.net.ResponseException: Error communicating with Jira, {"errorMessages":\[\],"errors":{"assignee":"data was not an object"}}".

I know 100% the user I'm trying to assign the ticket (myself) is allowed.

Using Form Field Definition Field Type "Dynamic Drop down (auto suggest) which does appear to be interfacing correctly.

{ "fields": { "project": { "key": "DSAG" }, "summary": "\[entry.summary\]", "description": "\[entry.description\]", "assignee": "\[entry.assignee\]", "issuetype": { "name": "Story" } } }

THNX


author: Alex Medved _ConfiForms_
body: Is this for Jira cloud? This error often means that assignee needs to be in another format... using "id" attribute

```
"assignee": {
"id": "[entry.assignee]"
}
```

If it is for Jira server then I believe the mapping is something like

```
"assignee": {
"name": "[entry.assignee]"
}
```

Also, very often Jira is set up so that you cannot set the assignee yourself via API (it is restricted). Please verify that you actually can


author: Frank Rentef
body: This is Jira Server.


author: Mikael Sandberg
body: To create a new Jira issue from within Confluence do the following:

1. Select Edit to open up the page editor
2. In the editor, select Insert (or +) \> Jira
3. Choose Create New Issue
4. Select the Jira project, the issue type and enter a summary and a description, and once done click Insert to create the issue.

You can also create an issue by highlighting some text on the page and select Create Issue that will be shown over the highlighted text.

See [Use Jira applications and Confluence together](https://confluence.atlassian.com/doc/use-jira-applications-and-confluence-together-427623543.html) for more information. Note that you (or your admin) have to set up the application links between Confluence and Jira for this to work.


Tags: confluence-server

server