Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set control condition for fields..

Anni R
Contributor
April 19, 2012

Hi!

Is it possible to set control condition for fields and assinging?

For example:

I have specific fields and if I fill those with spesific values the system will control those fields and will assign it to person who deal with those issues.

Example:

Components: test

Environment: jira

Jira will automatically assign this issue to X person

If there are

component: live, jira will know that this issue need to assign to another person Y.

Is it possible to set such conditions to control fields?

Thanks in advance.

2 answers

1 accepted

0 votes
Answer accepted
Mizan
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 19, 2012

This is possible through many ways , i would suggest using Script runner plugin . You will need to write a groovy script and add it as a post function on create transition , the script will check the customfield values and based on that assign issues to a user specified in the script .

Anni R
Contributor
April 19, 2012

Ok, thanks. I have installed this plugin (groovyrunner) 2.0 4. So where I can write a script and how I can add it? If I add this condition under workflow->transitions->postfunctions it will be depend when status will change, but where and how I can control fields value before assigning them?

Mizan
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 19, 2012

You have to write a script and save it as a groovy file(.groovy) in your filesystem(server machine)

you can add this script to control your fields on each workflow step as a postfunction.

After you select the add postfunction >>add script post function >>To add the script as a postfunction you will have to provide a complete path to your script in path.

Anni R
Contributor
April 19, 2012

Thanks a lot!

Mizan
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 19, 2012

Welcome :) you can vote up my answer,comments

below is pseudo code for the scripthope it helps :)

UserManager userManager = UserManager.getInstance();	

MutableIssue mutableissue = (MutableIssue) issue;

def components=issue.getComponentObjects() //this returns a collection of selected components


def environment=issue.getEnvironment()//this returns a string 


if(component=="x"&&environment=="y")
{

User issueAssignee = userManager.getUser("user_name");

}

issue.setAssignee(issueAssignee)

issue.store()

0 votes
Renjith Pillai
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 22, 2012

May be I stating the obvious, but if your requirement is to just handle the component based assignment of issues, this is something natively supported in Jira. See http://confluence.atlassian.com/display/JIRA/Defining+a+Component#DefiningaComponent-SelectingaDefaultAssignee

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events