post function Expression

Dmitriy Kalabin July 16, 2017

Hi, i have a code in the post function, condition "if Is1 == 'ABIS Colvir':" work only expressions in Latin...

If we write the condition in Russian, then it does not hold, Example

"if Is1 == 'АБИС':"

what could be the problem?

 

from com.atlassian.jira.component import ComponentAccessor
from com.atlassian.jira.issue import CustomFieldManager
from com.atlassian.crowd.embedded.api import User
from com.atlassian.jira.issue import Issue
from com.atlassian.jira.issue import MutableIssue
from com.atlassian.jira.issue import IssueManager
from com.atlassian.jira.security.groups import GroupManager
from com.atlassian.jira.security.roles.actor import UserRoleActorFactory

customFieldManager = ComponentAccessor.getCustomFieldManager()
customField = customFieldManager.getCustomFieldObject("customfield_10100")
Is1 = issue.getCustomFieldValue(customField).getValue()

Ur_dit = ComponentAccessor.getGroupManager().getUserNamesInGroup("K2_ABIS")

if Is1 == 'ABIS Colvir':
for key in Ur_dit:
issue.setAssigneeId(key)

1 answer

0 votes
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.
September 26, 2017

I tried the below code in script console and it returns true

def sa='АБИС'

if (sa == 'АБИС')
return true

I am not sure but it seems your if needs parenthesis { } .

try some logging and see the values returned by JIRA for the customfield 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events