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 (abc@amway.com) 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
issue.getReporter().getEmailAddress()
by using code we get reporter mail here how do we compare email domain
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,
Nic
This is definitely possible, and you can achieve this with different apps - like the one mentioned by Nic. Which one are you currently using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"))
{
usertype.setFormValue("Employee")
}
else
{
usertype.setFormValue("Contractor")
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.