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

getcustomfieldvalues with out issue key

Hi, i am able to get the single select customfield value with following code:

import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue

IssueManager im = ComponentAccessor.getIssueManager()
MutableIssue issue = im.getIssueObject("issue key id")

if(issue){

//get the value
def customFieldManager = ComponentAccessor.getCustomFieldManager()
//def cField = customFieldManager.getCustomFieldObject("customfield_10500")

def cField = customFieldManager.getCustomFieldObjectsByName("customfield name")[0]
def cFieldValue = issue.getCustomFieldValue(cField)




}else {

return "Issue doesn't exist"
}

 

But i need to get all values of single select customfield without issue key id ?

 

can someone help me please

1 answer

0 votes

In which app (addon) are you writing this code?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Do you miss a recurrence feature in Jira to handle your managed service contracts?

  If your company uses Jira and Tempo and deals with managed services, you probably have already struggled with these tools to find a solution that gives you a way to create or simulate contrac...

43 views 0 0
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