How can I default to a user (such as reporter) in a transition but still keep it changeable?

Deleted user April 13, 2017

I am new to Jira and am trying to figure out how to accomplish this in our workflow.

Problem:

We have a Needs Info state where in most cases it should assign to the reporter. I don't want to ONLY allow this though as the user might need to assign it to a different person for the info that they need. This means that a post function will not work for me as far as I can tell. So, what I would like to be able to do is have the Assignee field defaulted to reporter but use the selected Assignee if the user changed it to someone else.

So far I have not been able to figure out a way to make this work.

Some of what I have tried

  1.  I tried using the "Update on Transition" add on to detect if the Assignee was blank during a transition and then set it to reporter thinking that if a value was selected that it would use that instead 
  2. I then came across JJupin and thought it would work since they seem to describe exactly what I want to do through live fields here  but so far I have not been able to get this to work either.

Has anyone else run into this problem and figured out how to solve it? Setting default values in the transition screens that could then be changed would be the ideal solution.

Thanks,

Doug

 

 

2 answers

0 votes
Alex Christensen
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 14, 2017

Do you have ScriptRunner installed? We are on Server using ScriptRunner and I was able to use this scripted post-function - if the Assignee field is left as "Automatic" when creating an issue, then the issue gets assigned to the Reporter. You could use this in your transition - this would allow you to choose an Assignee, or leave it as "Automatic" and then the issue would be assigned to the Reporter.

import com.atlassian.jira.issue.MutableIssue
import webwork.action.ActionContext

String assigneeFormValue = ((String[])webwork.action.ActionContext.getRequest().getParameterMap().get("assignee"))[0];
if (assigneeFormValue == '-1') {
    issue.assignee = issue.reporter
}

ScriptRunner says there's an error in this code (error with casting object types), but this works on our instance of JIRA correctly. Also, I've never used ScriptRunner in Cloud, so if you're on Cloud, I don't know if scripted post-functions are possible or not.

Deleted user April 14, 2017

That is close to being workable for us. The problem is that this is not on the create transition so when the transition is chosen, it will have the current assignee populated in the assignee field. 

I suppose we might be able to detect if the assignee has been changed or not and assign to reporter if it has not changed. That should give me the functionality I want but would not be immediately obvious to the user. Still, it might be better than nothing. Now I have to figure out what that would look like in the script.

The JJupin option might still be a possibility. I was able to get it to display the reporter in the transition screen and assign to them. The problem is that even if I change it, it still goes to the reoprter. :( They say this is a bug that they are going to fix...fingers crossd that it happens soon.

0 votes
Sam Hall
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 13, 2017

My intial thought, to save having to use an add-on, is why not have two transitions?

Something like:

  • 'Ask reporter for more info' - Has post-function to auto-assign to reporter.
  • 'Ask someone else for more info' - Has 'Assignee' field on transition screen for user to pick who they want to assign to.
Deleted user April 13, 2017

Sure that could work but it seems a bit silly to have 2 transitions for this. Our hope was to keep things as simple (in appearance) as possible. This was something that our old DB was able to do easily and something that seems like it should be possible in Jira.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events