Forums

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

Need to auto assign to a particular group when ticket is created

Parsa Mounika March 2, 2022

Hi,

In a project when a issue is created it should be auto assign to a particular group.

CAPTURE.PNG

4 answers

2 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
March 2, 2022

Hello @Parsa Mounika 

Welcome to the community.

The Assignee field is a User Picker (single select) field. You cannot select a Group in that field. 

Assignee should be used to designate the one person responsible for the issue at a given point in time. If you "assign" the issue to a group, then you never know which member of the group is actually responsible for the issue.

Instead I would recommend you use another field for selecting a Group. It has been a while since I worked with Jira Server, so I don't know anymore if it has native functionality to automate setting the field. Do all the issues in the project get assigned to the same group? If so, you should be able to do that as a Post Function in the workflow on the Create transition.

Parsa Mounika March 2, 2022

Hi @Trudy Claspill 

Thanks for the quick response.

Yes all the issues in the project get assigned to the same group. I tried with post function also but when the ticket is IN PROGRESS I can assign it group. But when the ticket is created I can' t assign it group.

Trudy Claspill
Community Champion
March 2, 2022

Can you provide a screen image of what you are seeing when trying to add the post function to the Create transition.

Parsa Mounika March 2, 2022

Can you please tell me how to do using post functions in the workflow on create transition using Assignee group.

Trudy Claspill
Community Champion
March 2, 2022

Here is the documentation related to advanced workflow management, including a section on Post Functions.

https://confluence.atlassian.com/adminjiraserver/advanced-workflow-configuration-938847443.html

I don't have access to a Jira Server instance so I can provide the detailed steps or screen images.

Parsa Mounika March 3, 2022

Hi @Trudy Claspill 

When tickets are created the Assignee = Unassigned and the Assigned Group = I_TRF_CCOD_T3

Can you please suggest a post function for this.

Trudy Claspill
Community Champion
March 3, 2022

When you are modifying the workflow and in the Post Functions tab click Add, what are the options you get? There should be one for Set Field or Set Value or something like that.

Parsa Mounika March 3, 2022

@Trudy Claspill Thanks for the help. The issue has be resolved.

0 votes
Answer accepted
Sachin Dhamale
Community Champion
March 2, 2022

@Parsa Mounika ,

In Jira issue is assigned to Single User Only Not Group.

You can create Select Group field and use that one for your purpose. you can use following script to update that group picker field in the postfunction

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.util.IssueChangeHolder

//Get Issue Object
Issue issue  = issue    //The issue object is internally retrieved in the post-function

//Get instance of Custom Field Manager
def customFieldManager = ComponentAccessor.getComponent(CustomFieldManager)
//Initialize variables to setup group picker & automation type custom field value
def groupManager = ComponentAccessor.getGroupManager()
def singleGroupCf = customFieldManager.getCustomFieldObject("customfield_12700")

def group = groupManager.getGroup(<YOUR JIRA USER GROUP NAME>)
List groupList = new ArrayList()
groupList.add(group)
IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
singleGroupCf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(singleGroupCf), groupList), changeHolder)
issue.store()

 

Accept the answer if it helps

Parsa Mounika March 3, 2022

Hi @Sachin Dhamale 

Thanks for the response.

Can you please suggest a post function for this.

When tickets are created the Assignee = Unassigned and the Assigned Group = I_TRF_CCOD_T3

Sachin Dhamale
Community Champion
March 3, 2022

@Parsa Mounika ,

Above script can be used to update the Assigned Group custom field

def group = groupManager.getGroup(I_TRF_CCOD_T3)
// Here you can mention the I_TRF_CCOD_T3 group name
def singleGroupCf = customFieldManager.getCustomFieldObject("customfield_12700") 
// Here you can mentioned the custom field id of Assigned Group Custom Field

 

For  Assignee = Unassigned  - You can use the inbuilt post function called issue field update there you can update assignee field with unassignee.

 

Accept the answer if it helps

Parsa Mounika March 3, 2022

@Sachin DhamaleThanks for the help. The issue has be resolved.

jun lee
Contributor
March 16, 2023

Hi @Sachin Dhamale 

 

I want to update custom field ENM_Sys_Agree(Group Picker) with ENM_Sys_A_agree user group when user select ENM_system as System A, and ENM_Sys_Agree(Group Picker) with ENM_Sys_B_agree user group when user select ENM_system as System B, and so on.

 

ENM_system is A -> Update ENM_Sys_Agree with ENM_Sys_A_agree user group

ENM_system is B-> Update ENM_Sys_Agree with ENM_Sys_B_agree user group

...

Could you change your script for help?

1 vote
Jason Michaud
Contributor
March 15, 2022

Just adding my 2-cents here as I think you (Parsa) are in the same boat as we are. I went live with our Jira instance over 4 years ago and we utilized that Team concept - so I created a custom field called "Assignment Group" and also created a jira user work group for every team. Each member of our IT department was  a member of one of those groups. Then we had a backend - Scriptrunner listener that listened for issue updates for those 2 particular fields - Assignment Group and Assignee. When one did not match what group they should be part of - it would auto-update so that way the assignment group would always match up to the Team name that the Assignee was a member of. Well fast forward to our last upgrade and that rule concept developed numerous issues that were ghosting issues on certain teams dashboards and filters.

I had to quickly implement another process that would reflect our team concept. Whether this is right or wrong - I still proceeded down this path and it has been working fine for us for over 2 weeks now.

I created an Internal Jira User for each of our 18 teams. The name of each Internal Jira User created is the actual Team name. For notification purposes - every team already has an exchange group email - so we utilized their group email for the internal Jira team name user. I repurposed the Jira User Work Groups for the same teams and made each of the internal Jira team name users members of their respective Jira user work group. On issue transitions that needed to be reassigned to a team - I added a specific transition so that the transition button only displayed the team names. We can also utilize this concept for the auto-assignment of issues from the customer portal customer requests.

So far so good - but I'm sure there are a few cons for proceeding down the path I chose; but none have boiled up as being Major issues thus far.

Hope my idea helps.

0 votes
Ansari_ Amir February 17, 2024

I found a solution, please go to this link. Thank me later :)

Solved: Can Automation set the Team field when an issue is... (atlassian.com)

Trudy Claspill
Community Champion
February 17, 2024

@Ansari_ Amir 

The solution you reference is for Jira Cloud. It does not apply here as this post concerned Jira Server/Data Center.

Suggest an answer

Log in or Sign up to answer