Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update Custom filed based on users email address in service Desk

Generally we are getting  tickets through user's email in service desk  when user raise a ticket through mail or service desk portal  based on  user email domain    the custom filed should be updated 


example: we have  abc (  when abc raise a ticket based his domain(amway)  the (customfiled ) usertype should be amway. 


how can we do this through scripting it is possible or not


by using code we get  reporter mail here how do we compare email domain

2 answers

Hi @Lakshmi Yaganti ,
this usecase can be realized with Jira Workflow Toolbox.

It provides a post function to update fields. You'll get the company domain with the following parsing code: 
nthElement(toStringList(%{00007}, "@"),2)

Best regards, 

0 votes
Ivan Lima Community Leader Feb 07, 2021

This is definitely possible, and you can achieve this with different apps - like the one mentioned by Nic. Which one are you currently using?

No , we didn't using

but i got  domain name by creating script filed and i need to compare, if script filed ==away ,  usertype must be  employee ,else useertype  contractor , in this scenario i am unable  to get script value 


def queueCf = customFieldManager.getCustomFieldObjectsByName("Domain")
String qname = issue.getCustomFieldValue(queueCf)
def usertype= getFieldById("customfield_15502")

if(selectedDomain.toString() == ("away"))



Ivan Lima Community Leader Feb 08, 2021

@Lakshmi Yaganti, It seems you're using groovy to handle your use case. Which app/add-on, and Jira version are you on? I just wanted to get some clarity on that so we can better assist you here.

JIRA (Datacenter )8.5.1

Ivan Lima Community Leader Feb 10, 2021

Well, assuming you're using ScriptRunner or any other app that handles your groovy, you could try something like:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField

def selectedDomain = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_15502")

String strSelectedDomain = issue.getCustomFieldValue(selectedDomain) as String

if(selectedDomain == "away") {

// your code


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

254 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you