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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Our behaviours script doesn't work for customer on service desk portal

Hi everyone,

 

Our script is here,


import com.atlassian.jira.component.ComponentAccessor

def singleSelect = getFieldById(getFieldChanged())
def optionsManager = ComponentAccessor.getOptionsManager()

def cf = getFieldById("customfield_12705")
def cfField = customFieldManager.getCustomFieldObject(cf.getFieldId())
def cfConfig = cfField.getRelevantConfig(getIssueContext())
def cfOptions = optionsManager.getOptions(cfConfig)
def cfA
if(getRequestTypeName() == "E-imza"){
cfA = cfOptions.findAll { it.value in ['E-Imza Talebi', 'E-Imza Süre Uzatımı', 'E-Imza Iptali'] }.collectEntries { [ (it.optionId.toString()) : it.value ] }
}else if(getRequestTypeName() == "Şube Açılış Kapanış Taşınma Işlemleri"){
cfA = cfOptions.findAll { it.value in ['Bilgi-Belge Talebi', 'Mersis Talebi'] }.collectEntries { [ (it.optionId.toString()) : it.value ] }
}else if(getRequestTypeName() == "Sözleşmeler"){
cfA = cfOptions.findAll { it.value in ['Sözleşme Müzakeresi (Yeni imzalanacak anlaşmalar için)', 'Sözleşme taahhüt kontrol dönüşleri', 'Sözleşme Fesih Talepleri', 'Sözleşme Revizyonu (İmzalanmış sözleşmelerde kişi sayısı vb değişiklikler için)', 'Ek Sözleşme Talebi (Mevcut anlaşmalarda değişen koşullar için)'] }.collectEntries { [ (it.optionId.toString()) : it.value ] }
}else if(getRequestTypeName() == "Promosyon Tutarı"){
cfA = cfOptions.findAll { it.value in ['Promosyon Artış Talebi', 'Promosyon Ödeme Uygunluğu'] }.collectEntries { [ (it.optionId.toString()) : it.value ] }
}else if(getRequestTypeName() == "Yeni Anlaşma Talepleri"){
cfA = cfOptions.findAll { it.value in ['İnternetten Havale/EFT muafiyet talebi', 'Kredi kartı muafiyet talebi', 'Diğer komisyon muafiyet talepleri'] }.collectEntries { [ (it.optionId.toString()) : it.value ] }
}
cf.setFieldOptions(cfA)

Same script work for admin user, but  doesnt work for customer. Customer can see all option in select list.

Does anyone have any idea?

 

0 answers

Suggest an answer

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

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

170 views 0 4
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