Creating a project template (2024)

Applicable:

Jira 7.0.0 and later.

Level of experience:

Intermediate. You should have completed at least one beginner tutorial before working throughthis tutorial. See the list of developer tutorials.

Time estimate:

It should take you approximately 1 hour to complete this tutorial.

Project template apps were originally supported in Jira 6.0 with the project-template module. However,Jira 6.0.7 introduces the project-blueprint plugin module that provides additional capabilities and ismeant to substitute the project-template module. We strongly encourage you to use the project-blueprintmodule for project template app development, as described in this tutorial.

Overview of the tutorial

Jira project templates allow administrators to quickly create Jira projects with a predefined set of projectconfiguration settings and properties. Jira comes with several built-in project templates, but you can createyour own as Jira apps using the project-blueprint plugin module.

Besides hooking into the Jira project creation process, a project template app can define issue type schemes(with a set of custom issue types) and workflow schemes that link the issue types to Jira workflows.

This tutorial shows you how to build a project template app. Our project template will define a custom issue typescheme with three issue types and a workflow scheme with two imported workflows.

The completed Jira app will consist of the following components:

  1. Java classes encapsulating the app logic.
  2. Resources for display of the app UI (user interface).
  3. An app descriptor (XML file) to enable the plugin module in the Atlassian application.
  4. A configuration JSON file for your Project Template.
  5. A couple Jira workflow bundles for importing the workflows in your project template.

When you are finished, all these components are packaged in a single JAR file.

About these instructions

You can use any supported combination of OS and IDE to create this app. These instructions were written using IntelliJIDEA 2017.3 on macOS Sierra. If you use another OS or IDE combination, you should use the equivalent operationsfor your specific environment.

This tutorial was last tested with Jira 7.7.1.

Before you begin

To complete this tutorial, you need to know the following:

  1. The basics of Java development: classes, interfaces, methods, how to use the compiler, and so on.
  2. How to create an Atlassian plugin project using theAtlassian Plugin SDK.
  3. How to use and administer Jira, particularly how to configure Jira projects.

App source

We encourage you to work through this tutorial. If you want to skip ahead or check your work when you have finished, youcan find the app source code on Atlassian Bitbucket.

To clone the repository, run the following command:

12
git clone git@bitbucket.org:atlassian_tutorial/jira-project-templates-tutorial.git

Alternatively, you can download the source as a ZIP archive:

Step 1. Create the app project

In this step, you'll use theatlasSDK to generate stub code for your app. Theatlascommands are part of theAtlassian Plugin SDK and automate much of the work of app development for you.

  1. Set up the Atlassian Plugin SDK and Build a Projectif you have not done it yet.

  2. Open a Terminal and navigate to the directory where you want to create the project.

  3. To create an app skeleton, run the following command:

    12
    atlas-create-jira-plugin
  4. To identify your app, enter the following information.

    group-id

    com.example.plugins.tutorial

    artifact-id

    my-project-template

    version

    1.0-SNAPSHOT

    package

    com.example.plugins.tutorial

  5. Confirm your entries.

    The SDK generates the project home directory with project files, such as the POM (Project Object Model definition file),stub source code, and app resources.

  6. Delete the test directories.

    Setting up testing for your app isn't part of this tutorial. To delete the generated test skeleton,run the following commands:

    12
    rm -rf src/test/resourcesrm -rf src/test/java
  7. Delete the unneeded Java class files.

    12
    rm -rf src/main/java/com/example/plugins/tutorial
  8. Import the project to your favorite IDE.

Step 2. Tweak the POM

It's a good idea to familiarize yourself with theproject configuration file, known as the POM.Among other functions, the POM declares project dependencies and controls build settings.It also contains descriptive information for your app.

Tweak the metadata and add a dependency as follows:

  1. Navigate to the root folder of your project and open the pom.xml file.

  2. Add your company or organization name and website URL to theorganizationelement:

    12
    <organization> <name>Example Company</name> <url>http://www.example.com/</url></organization>
  3. To add a meaningful description, edit the projectdescriptionelement. For example:

    12
    <description>This is the Project Template plugin tutorial for Atlassian Jira.</description>

    Theorganizationanddescriptionvalues you enter are propagated to the app descriptor file,atlassian.plugin.xml.From there, Jira uses them in the administration console display for your app.

  4. Under the dependencies element, add a dependency to the Project Templates API artifact:

    12
    <dependency> <groupId>com.atlassian.jira.plugins</groupId> <artifactId>project-templates-api</artifactId> <version>6.2.0</version> <scope>provided</scope></dependency>
  5. Save the file.

If working in an IDE, you need to refresh the dependencies in your project now.

Step 3. Add the plugin module to the app descriptor

Now you will add plugin modules to your app descriptor. The app descriptor is an XML file that identifies theapp to Jira and defines the functionality that the app requires. We need to add two plugin modules: one for ourproject template and another for a web resource.

Project templates have their own module type called project-blueprint which takes care of the necessary configuration.Add it to your descriptor as follows:

  1. Navigate tosrc/main/resources and create a new soy folder.

  2. Create new Soy template MyProjectTemplate.soy with the following content:

    12
    {namespace JIRA.Templates.ProjectTemplates.Tutorial}/** * Render the information page for My Project Template. */{template .renderMyProjectTemplateExplanation} <p>{getText('my.project.template.info.page.description')}</p>{/template}

    We will use this template for project info page.

  3. Open the atlassian-plugin.xml file and add the following as a child of the atlassian-plugin element:

    12
    <atlassian-plugin ...> ... <web-resource key="my-project-template-resources" name="my-project-template Web Resources"> <dependency>com.atlassian.auiplugin:ajs</dependency> <transformation extension="soy"> <transformer key="soyTransformer"/> </transformation> <transformation extension="js"> <transformer key="jsI18n"/> </transformation> <resource type="download" name="MyProjectTemplate.soy.js" location="/soy/MyProjectTemplate.soy"/> <resource type="download" name="images/" location="/images"> <param name="content-type" value="image/png; charset=binary"/> </resource> <context>atl.general</context> <context>atl.admin</context> </web-resource> <project-blueprint key="my-project-template" weight="90"> <label key="my.project.template.name"/> <projectTypeKey>business</projectTypeKey> <description key="my.project.template.description"/> <longDescription key="my.project.template.description.long"/> <infoPage soy-template="JIRA.Templates.ProjectTemplates.Tutorial.renderMyProjectTemplateExplanation" /> <icon location="images/my-template-icon.png"/> <backgroundIcon location="images/my-template-background.png"/> <add-project> <hook class="com.example.plugins.tutorial.MyAddProjectHook"/> <descriptor file="/config/my-project-template-config.json"/> </add-project> </project-blueprint> ...</atlassian-plugin>

    At a minimum, you would only need to add the project-blueprintelement, but since we're also adding an optionalinformation page to the wizard, we need to define aweb-resourceelement as well. Our web-resourceelementidentifies the Soy template file that presents our text page in the wizard.

Let's take a closer look at the attributes and child elements of theproject-blueprint app that we defined here.

Name*Description
key

The identifier of the plugin module. The key should be unique in the context of your app.

weight

Determines the order in which the project templates appear.

Default: 100

labelThe key attribute defines the localization key for the human-readable name of the plugin module. This name is used to identify the project template in the Project Templates dialog.
projectTypeKey(Jira 7.0+) All the project templates must provide the key for the type of the projects created with the template. Valid values for the project type key are "business", "software", and "service_desk".
descriptionThe key attribute defines the localization key for the human-readable short description of the plugin module. This description is used on the first page of the project templates dialog where all the available project templates are listed.
longDescription

The key attribute defines the localization key for the human-readable long description of the plugin module. The long description is used on the right side of the Create Project form of the Project Templates dialog wizard. If no longDescription is specified, the short description is used.

Default: description.

infoPage

Thesoy-template attribute refers to a Soy Template that renders a page in the Project Templates dialog. Typically, you would use this page to explain the characteristics of the Project Template to Jira administrator.

Make sure that the Soy Template is also declared as a web-resource in both atl.general and atl.admin contexts. The information page will be shown after the administrator selects your Project Template from the initial Project Templates selection dialog. If you do not define an infoPage element, the Project Templates wizard skips that step and goes directly to the Create Project form of the wizard.

Default: No information page.

icon

The location attribute defines an icon to be used when listing the available project templates in the selection screen of the Project Templates dialog.

Default: default icon.

backgroundIcon

The location attribute defines the background image to use on the Create Project form of the wizard.

Default: default background image.

add-projectHolds the custom configuration instructions for the project that will be created.

*key, label, projectTypeKey, description are required.

Theadd-projectelement also holds a number of configuration parameters that are specific for the actual project creation.

NameDescription
hook

The class attribute refers to the Java class that implements the AddProjectHook interface. This allows project templates to hook into the validation and configuration of Jira projects.

descriptor

The file attribute refers to a JSON file which defines parts of the configuration for the project.

Step 4. Generate workflow bundles

Project templates can incorporate one or more Jira workflows as part of their project configuration. To incorporate aworkflow in your project template, you first need to define the workflow in an existing Jira project, and then use theworkflow sharingfeature to export the workflow from there.

Exporting a workflow results in a Jira workflow bundle (.jwb) file, one for each exported workflow. You can then use the.jwb file in your project template app. Keep in mind that an exported Jira workflow doesn't include custom fields,post functions, validators, and conditions. If you want your workflow to have this functionality when using a project template,you can use theAddProjectHookto create it.

  1. To get a workflow bundle file for the app, do one of the following:

    1. Create a workflow export bundle of the workflow you want to use in your project by following theinstructions for exporting a workflow.
    2. Get the workflow bundles we've built for you. The bundles are in thesrc/main/resources/wfb/ directory of theBitbucket repository for this tutorial.
  2. In a new directory under your src/main/resources/wfb, save the workflow bundle file.

Step 5. Set up the JSON configuration file

The JSON configuration file allows you to declare a number of configuration options for your project template:

  • Issue types
  • Issue type scheme
  • Workflows
  • Workflow type scheme
  • The mapping of issue types to workflows

The JSON configuration file for a project template is optional and is needed only if thehookelement is declared in theadd-projectelement of aproject-blueprintplugin module. In this step, we add one.

  1. Navigate to src/main/resources/config and create a new JSON file namedmy-project-template-config.json.

  2. Add the following code to the file:

    my-project-template-config.json

    12
    { "issue-type-scheme": { "name": "my.project.template.issuetype.scheme.name", "description": "my.project.template.issuetype.scheme.description", "issue-types": [ { "key": "issueType1", "name": "New Feature", "description": "A new feature of the product, which has yet to be developed.", "icon": "/images/icons/newfeature.png", "workflow": "wf1" }, { "key": "issueType2", "name": "Bug", "description": "A problem which impairs or prevents the functions of the product.", "icon": "/images/icons/bug.png" }, { "key": "issueType3", "name": "Sub-Task", "description": "The sub-task of the issue", "icon": "/images/icons/subtask_alternate.png", "sub-task": true, "workflow": "wf2" } ] }, "workflow-scheme": { "name": "my.project.template.workflow.scheme.name", "description": "my.project.template.workflow.scheme.description", "default-workflow": "wf1", "workflows": [ { "key": "wf1", "name": "my.project.template.workflow.wf1.name", "workflow-bundle": "/wfb/Issue-Tracking-Workflow.jwb" }, { "key": "wf2", "name": "my.project.template.workflow.wf2.name", "workflow-bundle": "/wfb/Software-Development-Workflow.jwb" } ] }}

In my-project-template-config.json and atlassian-plugin.xml we defined few icons.Download them from Bitbucketand place under src/main/resources/images.

Let's take a closer look at the meaning of the configuration options here:

  • The values ofnameanddescriptionattributes ofissue-type-schemeandworkflow-schemerefer to i18n keys.
  • Thekeyattribute of an issue type only serves as an internal identifier within the project templates infrastructure.
  • Theiconattribute of an issue type refers to an icon location in thesrc/main/resourcesdirectory of your app.
  • Thesub-taskattribute of an issue type lets you declare whether the issue type is a normal issue type(default) or a sub-task.
  • If the issue types that are declared in theissue-type-schemedon't exist in the Jira instance, they arecreated using the declared configuration.
  • Thekeyattribute of a workflow can be used to map issue types to workflows, or to declare thedefault-workflowfor aworkflow-scheme.
  • Thedefault-workflowattribute of aworkflow-schemelets you define which workflow to use if an issue typeis used without an explicit workflow mapping. The value refers to thekeyattribute of a workflow.
  • Theworkflow-bundleof a workflow refers to a Jira workflow bundle location in thesrc/main/resourcesdirectory of your app.

Step 6. Write Java class

In this step you write the Java class. This example simply creates a basic project which checks whether the projectkey is not "TEST". When the project is successfully created, it redirects the user from the Create project dialogto the Issues Browser.

  1. Navigate to src/main/java/com/example/plugins/tutorial and create a new class namedMyAddProjectHook.

  2. Add the following code to the class:

    MyAddProjectHook

    12
    package com.example.plugins.tutorial;import com.atlassian.jira.project.template.hook.AddProjectHook;import com.atlassian.jira.project.template.hook.ConfigureData;import com.atlassian.jira.project.template.hook.ConfigureResponse;import com.atlassian.jira.project.template.hook.ValidateData;import com.atlassian.jira.project.template.hook.ValidateResponse;public class MyAddProjectHook implements AddProjectHook{ @Override public ValidateResponse validate(final ValidateData validateData) { ValidateResponse validateResponse = ValidateResponse.create(); if (validateData.projectKey().equals("TEST")) { validateResponse.addErrorMessage("Invalid Project Key"); } return validateResponse; } @Override public ConfigureResponse configure(final ConfigureData configureData) { return ConfigureResponse.create(); }}

Notice that the new class implements theAddProjectHookinterface. The interface defines two methods:

  • validate()allows your app to validate the parameters to be used for creating the project. It takes theparameters as an argument, and can return errors in theValidateResponseobject. The errors, if any, are mergedwith any other errors resulting from Jira's project validation and are returned to the client.
  • configure()performs setup actions for the project post-creation. It takes the newConfigureDataas anargument, which holds all the created entities (project, workflow scheme, workflows, issue type scheme, and issue types).
    Theconfigure()function can be used for a wide variety of configuration options. For example, you can usethis to create Workflow Post Functions,Resolutions, and more.

Step 7. Add the i18n keys

In a couple of places we referenced i18n keys. We need to provide values for those i18n keys in the i18n properties file.

  1. Navigate tosrc/main/resources and openthe my-project-template.properties file.

  2. Add the following lines:

    12
    #put any key/value pairs heremy.project.template.name=My Project Templatemy.project.template.description=This is my custom Project Templatemy.project.template.description.long=This custom Project Template will create a new Project with customized workflows and issue types.my.project.template.info.page.description=Explain the configurations specifics of your template here.my.project.template.issuetype.scheme.name=My Project Template Issue Type Schememy.project.template.issuetype.scheme.description=This is my Issue Type Schememy.project.template.workflow.scheme.name=My Project Template Workflow Schememy.project.template.workflow.scheme.description=My Project Template Workflow Schememy.project.template.workflow.wf1.name=My Workflow 1my.project.template.workflow.wf2.name=My Workflow 2
  3. To ensure that this file is used for translations, makesure the following line is in youratlassian-plugin.xml:

    12
    <resource type="i18n" name="i18n" location="my-project-template"/>

Step 8. Build, install, and run the app

Now you're ready to try out the new project app:

  1. Open a Terminal and navigate to the project root directory.

  2. Run the following SDK command:

    12
    atlas-run

    This builds your app code, starts a Jira instance, and installs your app. This could take a few minutes.

  3. Find the Jira home page URL in the Terminal output and open it in your browser.

  4. Log in with the default admin/admin.

  5. Create a new project based on theMy Project Templatetemplate. This is the template you created.
    Creating a project template (1)

  6. Check that the information page is shown.
    Creating a project template (2)

  7. Enter a project name and a key, as usual.
    Creating a project template (3)

  8. ClickSubmit. Confirm that you are redirected to the issue browser page.

Congratulations, that's it!

Have a treat!

Next steps

To learn more about the customizing projects in Jira, go to these tutorials:

  • Adding menu items to JIRA.
  • Adding content to the Jira View Issue page.
  • Adding a JQL function to Jira.
Creating a project template (2024)

FAQs

How to create a template for a project? ›

Create a template

Specify a name for the new template in the template header, then press Enter. Click the Template Tasks section in the left panel. Click Start Adding Template Tasks. Click New Template Task to start adding tasks to your template.

Does Word have a project template? ›

Many project managers swear by Microsoft Word's project management templates. These templates allow you to track tasks, manage schedules and budgets, and keep all your project information in one place.

How do I create a project template documentation? ›

How to Create Project Documentation?
  1. Step 1: Collect all requirements and related in a central repository. ...
  2. Step 2: Be descriptive of the process and stages of the project. ...
  3. Step 3: Organize the information by stages and topics. ...
  4. Step 4: Collaborate with your team on reviews.
Jun 14, 2022

What is an example of a template? ›

A template is a form, mold or pattern used as a guide to make something. Here are some examples of templates: Website design. Creating a document. Knitting a sweater.

What should be included in a project template? ›

Typically, a project plan template includes essential project information, such as the project timeline, task due dates, the goal of the entire project, and project milestones, among other things.

What are the 7 parts of a project plan? ›

Let's dive into the details:
  • Step 1: Define your goals and objectives. ...
  • Step 2: Set success metrics. ...
  • Step 3: Clarify stakeholders and roles. ...
  • Step 4: Set your budget. ...
  • Step 5: Align on milestones, deliverables, and project dependencies. ...
  • Step 6: Outline your timeline and schedule. ...
  • Step 7: Share your communication plan.
Feb 2, 2024

How do I turn a Canva project into a template? ›

Publish designs as brand templates
  1. On the menu bar above the editor, click on Share.
  2. Click More.
  3. Search for “Brand template” and click on Brand template.
  4. Select where to store the template.

How do you create an open project? ›

To create a new project, click the green button + Project directly on the system's home screen in the Project section. Alternatively, you can use the green + button in the header menu to create a new project.

How to create a project plan template? ›

How to create a project plan in six steps
  1. Define your project scope. ...
  2. Identify and meet with stakeholders. ...
  3. Structure your project — deliverables, milestones, and dependencies. ...
  4. Set your project budget. ...
  5. Outline your schedule and timeline. ...
  6. Present the project plan to stakeholders.
Jul 26, 2023

Does Excel have a project plan template? ›

Excel has a Gantt chart template that can be used for project planning and allows you to manage your project with ease. Similar to Resource Guru's project planning template, Excel's template allows you to enter start dates, the project's duration, and where each task stands in terms of progress.

Is it possible to create a template in Word? ›

In Microsoft Word, you can create a template by saving a document as a . dotx file, . dot file, or a . dotm fie (a .

What is a project brief template? ›

A project brief is a short summary of the basic elements of a project. A brief allows teams to share project goals, strategies, and timelines with stakeholders.

Top Articles
Best Community Colleges in Maryland
✅ Logística de Coca-Cola: Qué es y cómo funciona [2022]
Woodward Avenue (M-1) - Automotive Heritage Trail - National Scenic Byway Foundation
Canya 7 Drawer Dresser
O'reilly's Auto Parts Closest To My Location
Danielle Moodie-Mills Net Worth
Ets Lake Fork Fishing Report
Kraziithegreat
Gabriel Kuhn Y Daniel Perry Video
Pitt Authorized User
Www.megaredrewards.com
Oppenheimer & Co. Inc. Buys Shares of 798,472 AST SpaceMobile, Inc. (NASDAQ:ASTS)
Does Pappadeaux Pay Weekly
Find your energy supplier
Revitalising marine ecosystems: D-Shape’s innovative 3D-printed reef restoration solution - StartmeupHK
Culvers Tartar Sauce
2016 Hyundai Sonata Price, Value, Depreciation & Reviews | Kelley Blue Book
Everything You Need to Know About Holly by Stephen King
Studentvue Columbia Heights
Cvb Location Code Lookup
Lesson 8 Skills Practice Solve Two-Step Inequalities Answer Key
Byte Delta Dental
Ally Joann
The Ultimate Guide to Extras Casting: Everything You Need to Know - MyCastingFile
Busted News Bowie County
Two Babies One Fox Full Comic Pdf
Strange World Showtimes Near Savoy 16
Plost Dental
Vera Bradley Factory Outlet Sunbury Products
Biografie - Geertjan Lassche
WPoS's Content - Page 34
Craigslist/Phx
Kattis-Solutions
Chattanooga Booking Report
Frostbite Blaster
Clark County Ky Busted Newspaper
Staar English 1 April 2022 Answer Key
Dallas City Council Agenda
Stafford Rotoworld
Sunrise Garden Beach Resort - Select Hurghada günstig buchen | billareisen.at
Weather Underground Bonita Springs
Danielle Ranslow Obituary
511Pa
Best GoMovies Alternatives
Lamont Mortuary Globe Az
LumiSpa iO Activating Cleanser kaufen | 19% Rabatt | NuSkin
Tyco Forums
855-539-4712
Wzzm Weather Forecast
Cars & Trucks near Old Forge, PA - craigslist
Https://Eaxcis.allstate.com
Primary Care in Nashville & Southern KY | Tristar Medical Group
Latest Posts
Article information

Author: Arline Emard IV

Last Updated:

Views: 5495

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Arline Emard IV

Birthday: 1996-07-10

Address: 8912 Hintz Shore, West Louie, AZ 69363-0747

Phone: +13454700762376

Job: Administration Technician

Hobby: Paintball, Horseback riding, Cycling, Running, Macrame, Playing musical instruments, Soapmaking

Introduction: My name is Arline Emard IV, I am a cheerful, gorgeous, colorful, joyous, excited, super, inquisitive person who loves writing and wants to share my knowledge and understanding with you.