Required

  • Application Link to you Jira (Primary)

  • Page Tree Creator Pro version (8.2 and higher)


With the PTC Create Issue Automation Macro you are able to create a Jira issue while you are creating new pages or a space with the Page Tree Creator Pro app.

On this page you can find some use cases and examples on how to configure and use this macro.

Create a Jira issues with the Page Tree Creator

Step 1: Add a PTC Create Issue Automation macro to your PTC Template or any Confluence page

Following the guide Create a Simple PTC Template

Step 2: Configure the PTC Create Issue Automation macro

Configure for example the macro like below with Placeholders.

  • Project Key → __Project Key__

  • Issuetype Id → __Issue Type__

  • Issue Summary → __Summary__

Save your page

Note: This are the minimum required configurations you need.

Step 3: Instantiate your new template with the PTC app

  • Use the Create Pages or Create Space Button

    • Also possible in the tools-menu on the right, Copy Page Tree or Create Space

    • Select a target and pages and click next

  • In the Replace Placeholder dialog, you can see the placeholders __Project Key__ and __Issue type__

  • Now you can select a Jira project, and then the issue type. The issue types may vary for different projects.

  • As soon as you select an Issue Type, all other associated fields for that particular issue type are loaded into the Replace Placeholder dialog.

    • For example Summary

    • All fields that are required in Jira

    • Added fields in the PTC Create Issue Automation macro (see below)

  • Fill out the fields and click “Create”

Final Result

On the new page, you will now find a Jira macro that links the Confluence page to the Jira issue:

On the Jira issue you can find a section “Issue Links” → “Description Page” there is your link to the Confluence Page.


Advanced: Combine with PTC Default Value macro

You are also able to combine the PTC Create Issue Automation macro with the PTC Default Value macro.

Note: You can use this functionality on following PTC Create Issue Automation macro fields:

  • Project Key

  • Issue Type ID

  • Summary

  • Linked Issue Key and Relationship

  • “Add fields”

Step 1: Add a PTC Create Issue Automation macro to your PTC Template or any Confluence page

Following the guide Create a Simple PTC Template

Step 2: Configure the PTC Create Issue Automation macro

Set placeholders for all fields.

  • Project Key → __Project Key__

  • Issuetype Id → __Issue Type__

  • Issue Summary → __Summary__

Step 3: Configure Pages with button (target page)

On the page where the PTC button is located (Create Pages or Create Space Button) insert a PTC Default Value macro for your placeholders (for example for __Project Key__).

Inside the macro body inset your default value (like you would use the PTC Default Value macro as normal)

For the project key placeholder you need to insert a valid project key e.g “TESTPRO

For the issue type you need to insert a valid issue type Id e.g “10102

  • in this case we insert the Project Key from our test project (“TESTPRO”)

Step 4: Instantiate your template with the PTC button

Now, you can see your previously selected project key, in the Replace Placeholder dialog .

The same applies to the issue type.


Advanced: Use newly created Issue Number on Confluence page(s) or macros

In the PTC Create Issue Automation macro you have the option to set a “Issue number placeholder” parameter, the placeholder you define here will be replaced on the Confluence page with the new created issue number.

  • In the page title or body

  • As page label

  • Confluence or Other third-party macros

It's also possible to recreate the complete Issue Key. The issue key can be used to link issues with one another like epic link, issue links or subtasks.

Note: The issue key consisting of two pieces of information:

Project Key and Issue Number

  • [project_key]-[issue_number] will be → PTC-21

For Example:

  • Define a placeholder for the project key inside the PTC Create Issue Automation (e.g __Project Key__) and configure a Issue Number Placeholder (e.g __Issue Number__).

  • Now you can combine these “__Project Key__-__Issue Number__” on the new page this will automatically replaced with the correct replacements. The final result will be a valid Issue Key which you can use freely.

    • Combine it with a the PTC Default Value macro (Epic Link, Linked Issue etc)

    • Combine it with the PTC Jira macro and Confluence Jira macro on a child page. (see PTC Jira macro)


Advanced: Create a linked issue

With these optional parameters, you are able to link Jira issues with each other

Step 1: Add a PTC Create Issue Automation macro to your PTC Template or any Confluence page

Following the guide Create a Simple PTC Template

Step 2: Configure the PTC Create Issue Automation macro

  • First, fill in all the required fields.

  • Add the two optional parameters

    • (1) “Linked Issue Relationship”

    • (2) “Linked Issue Key”

  • Configure the two fields

    • With Placeholders: __Relationship__ and __Issue to be Linked__

    • With static values:

      • Relationship: Id of link type. For example: “10001“ (clones) or “10001:inward” (is cloned by)

      • Linked Issue Key: key of the issue to be linked. For example “PTC-21”

  • Save your page

Get the id of your issue link types via REST API

https://<YOUR-JIRA-URL>/rest/api/2/issueLinkType
NONE

Step 3: Instantiate the page with the Tools-menu option or PTC Button

In the Replace Placeholder dialog, once you have selected a project and an issue type, all fields related to the PTC Create Issue Automation macro and your selection will appear.

The Relationship placeholder will be a drop down menu with all available options if not set as a static value

  • Select a Relationship

  • Enter a Valid Issue Key for the “Issue to be linked” placeholder

  • Click create

Open the newly created issue in Jira. Under Linked Issues, you can now see you issue relation.


Advanced: Add fields

Start with the article ”Get Field IDs - via REST API” to understand how you can collect your field id.

Step 1: Add a PTC Create Issue Automation macro to your PTC Template or any Confluence page

Following the guide Create a Simple PTC Template

Step 2: Configure the PTC Create Issue Automation macro

  • Fill in all the required fields.

  • Switch to the “Add fields” tab

  • Add a field id of your choice (in our case “description”)

    • “description” is the field id from the Jira Field “Description”

  • Click the “Add Field” button

  • Add a Placeholder of your choice (in our case “__Issue Description__) (it is also possible to set a static value for your “Jira Field Value”)

  • Save your page

Multi line format

It is possible to combine a Jira added field placeholder (e.g __issue description__) with a PTC Placeholder macro to set the type to “Multi Line”.

Additionally, combined with a PTC Default Value macro a multi line default value can be used.


Get Field IDs - via REST API

The Jira field id is not the same as the Jira field name!

But there is a simple way to determine the filed id of your Jira field.

Open the following URL in your browser, making sure that you substitute <YOUR-JIRA-URL> with your actual Jira Base Url.

https://<YOUR-JIRA-URL>/rest/api/2/field
NONE

This will return a list of fields including their ids. You can search for the field name and the "id" value is the field id you need.

Check out the Create Issue Automation macro page to see what field types are supported

Make sure you are logged in, otherwise you can not see all Jira fields.

Example

This is an example of the “Description” field.

  {
    "id": "description",    <--------- THIS IS THE FIELD ID
    "name": "Description",  <--------- THIS IS THE FIELD NAME YOU CAN SEE
    "custom": false,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
      "description"
    ],
    "schema": {
      "type": "string",     <--------- THIS IS THE FIELD TYPE
      "system": "description"
    }
  }
JSON

field name= Description

filed id= description