A special case of a web item creates a menu item that will open the Create Issue dialog with a predefined project, and optionally issue type.

This can be useful to workflow designers. Imagine a workflow where at one transition the user is required to create a new linked issue. Typically this is done by having a self or any to any transition which will created the linked issue with a post-function. Then the user is required to edit the linked issue further.

This built-in script removes this action from the workflow, and allows the linked issue to be edited in the create step.

Let’s go through an example. We’ll set up a web item which will open the Create Issue dialog to create a linked issue in another project:

create linked issue

Note the condition, which says that the link will be displayed only for one project, and a particular status.

We are placing the item in a new web section which we created in opsbar-operations.

We should see the link if the condition is fulfulled:

create blocking

Clicking the link should show the "new issue" dialog with the selected project and issue type prefilled:

create issue dialog

The problem here is that the issue won’t be linked automatically. The solution is integration with Behaviours.

Behaviours Integration

A Behaviour is required to pre-fill the Linked Issues field. We don’t want this behaviour to fire on every issue that it’s mapped to though. A behaviour script is able to get some information about how the create issue dialog was opened, which is the ID of the web item.

There are two API methods, that are available to all behaviours scripts, which facilitate this:


Gets the ID of the web item that was clicked, in the example above it would be link-create-blocking.


Gets the ID of the issue that was on the screen when the item was clicked.

With these we can create a behaviour, with the following initialiser function.

def issueManager = ComponentAccessor.getIssueManager()

if (getBehaviourContextId() == "link-create-blocking") {

    def contextIssue = issueManager.getIssueObject(getContextIssueId())

    getFieldById("summary").setFormValue("Issue created from ${contextIssue.key}").setReadOnly(true)
The behaviour must be mapped to the target project, but because you are checking the context ID, it won’t be fired when an issue is created in this project from the normal Create button.

This behaviour sets the link direction, and the linked issue. It also sets the summary and makes several fields read-only as you can see:

create issue linked