Jira: automatically set author of issue to "project lead"

jz April 7, 2014

Hi,

our workflow requires, that the owner of a issue always the project lead is. Is it possible to set the author of an issue to the project lead automatically?

Cheers

Jannik

3 answers

1 accepted

1 vote
Answer accepted
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.
April 7, 2014

You could do this with a script to override the reporter (script runner plugin is the easiest option). I'd strongly recommend doing it in the background - never offer the field to the user.

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.
April 7, 2014

I'm afraid you're stuck then, you do need a bit of code to do this.

jz April 7, 2014

Thank you for your comment. We are currently on an OnDemand instance, so this isn't possible).

But I understand, that this is currently not a "core" supported feature (= just configurable) but needs to be scripted by myself (although it seems reasonable easy to do - except the issue with OnDemand).

jz April 8, 2014

I found an easy way for my special case (see my own answer), but will accept your answer, as it fixes the issue in a more generic way.

0 votes
jz April 8, 2014

I actually found an easy way (for my special case).

The background of my question is, that I don't want "regular" users to change the assigned user - just a small selected part of the staff should do that.

If I remove the permissions to assign users from them and set the default assignee to the project lead, it works as intended, since they can't change it.

0 votes
Andris Grinbergs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 7, 2014

For new issues:

You will need to have separate workflow for each project/project lead, plugin"JIRA Misc Workflow Extensions" and plugin "JIRA Suite Utilities". I hope they are available for OnDemand.

1. Add custom field Owner to project

2. in your workflow open Create issue tranistion

3. Add postfunction "Update Issue Custom Field" Field "Owner" and as value use project lead username.

4. Add postfunction "Copy Value From Field to Field" (Copy from "Owner" to "Reporter")

5. Make sure about execution order (update should be before copy)

6. Publish workflow

For already existing issues:

Execute bulk change.

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.
April 7, 2014

This has some consequences - you're adding a "project owner" field to every single issue, and hard-coding the project lead's account into your workflow, so you need a different workflow for each project lead, and you'll need to edit the workflow when you change leads.

If you're willing to accept the change of project lead means workflow editing, then there's a far more simple approach - forget an "owner" field and simply set the reporter to the hard-coded user name. You don't need any plugins to do this if I remember correctly.

Personally, I wouldn't even attempt this, it's an immense amount of pain to set up and nearly as bad to maintain.

jz April 7, 2014

I would like to only use a single workflow instead of duplicating them throughout the system. So I guess I would use your version - if we ever decide to use the self hosted version.

Suggest an answer

Log in or Sign up to answer