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

How to get issue's 'request.channel.type' property with jira api

Hi All,

    I want to get an issue's 'request.channel.type' property to judge which way created issue with jira api, I know the jira rest api can help me do it, and I tried use following way to do it in scriptrunner

ComponentAccessor.getComponent(JsonEntityPropertyManager.class).get("IssueProperty",issueId).get("request.channel.type")

this way only be useful for issue that I have created, but I need to judge it when I get issue create event, so anyone can help me ? Thanks!

1 answer

Hello @Mack Chen

Try this

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def issue = ComponentAccessor.getIssueManager().getIssueObject("TEST-1")

IssuePropertyService issuePropertyService = ComponentAccessor.getComponentOfType(IssuePropertyService.class)
def entityProperty = issuePropertyService.getProperty(user, issue.id, "request.channel.type").getEntityProperty()

Thanks @Mark Markov, I tried this way, and the result is the same as the way I have showed, it's useful for issue that I have created, when issue create event trigger my groovy, I want to get this issue's 'request.channel.type'

The thing is that this property filling after ISSUE_CREATED event. This is how service desk api works.

As workaround, you can create listener on ISSUE_UPDATED event and catch whenever this field gets value.

@Mark Markov the code works perfect!!! Thanks,

Suggest an answer

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

How to log work and track time in Jira when a person is part of multiple teams

  The manager’s daily activities include a list of challenges to reach high levels of efficiency for their teams. Part of these challenges is related to how to deal with the worklog systems sin...

80 views 2 1
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