Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Accessing Origin Field of an Issue

I am not 100% how to ask this, or if this is the right place, but here is my situation.

I have been tasked with generating a report grouping the origins of tasks.

I see the field "Origin", and it is available as a column when I do searches.  However, when I access the issue via rest API - Origin nor it's ID is available.   Also, when added as a column in the search results it is empty.

Now, when I view an issue.   At the top is a nice little blurb that says - So and so raised this request via Portal/Jira/Email - which to me would be the Origin?!?!?!

How do I get that value programmatically - any ideas?   I am trying to do this all through scriptrunner,  but I can't seem to get that value anywhere - even though I can see it exists.  Is it a different field/id than Origin?

If this is the wrong place please accept my apologies and point me to the right location =)

2 answers

0 votes

Are you talking Server/DC or Cloud

I wonder where you see this "Origin" field in searches.

I have a "Channel" field visible on JSM issue view which can contain the values or Jira, Portal or Email. Maybe on cloud it's called Origin?

In my server case, "Channel" is a JSM issue property, not an actual field.

You should be able to get that with https://docs.atlassian.com/software/jira/docs/api/REST/8.5.15/#api/2/issue/{issueIdOrKey}/properties

Or in scriptrunner, 

import com.atlassian.jira.bc.issue.properties.IssuePropertyService
import com.atlassian.jira.component.ComponentAccessor
import groovy.json.JsonSlurper

def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issuePropertyService = ComponentAccessor.getComponent(IssuePropertyService)
def issue=ComponentAccessor.issueManager.getIssueObject('XXX-NNN')

def prop = issuePropertyService.getProperty(currentUser, issue.id, 'request.channel.type')
if(prop && prop.isValid() && prop.entityProperty.isDefined() ){
    (new JsonSlurper().parseText(prop.entityProperty.value.value as String) as Map).value
}

Sorry, it is Jira Cloud - so using Scriptrunner for Jira Cloud, which means I (as I understand it) don't have the ability to code it up in Java but rather Groovy leveraging the Rest endpoints.

The Origin field is (for me at least) found in the list of fields available to an issue, and when I do the search it is an available column to display - however, it is empty for all results.

I will check if Channel is an option, that may be what I need.


Hi Adam,

I have checked and it is not possible to access the Channel field which shows where an issue originated from inside of Jira Cloud due to the fact that Atlassian does not provide any public Rest API's to access this information.

ScriptRunner for Jira Cloud can only return information from Jira using the Rest API's that Atlassian provides and as Atlassian does not provide any API's to access this information in Jira Cloud then you will be unabe to access this information in your script.

I hope this information helps.

Regards,

Kristian

Suggest an answer

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

☕️ Monday coffee with Jexo: Weekly Atlassian news roundup | 21st June 2021

Hi community 👋, as every Monday we're bringing you a quick update on what happened in the Atlassian ecosystem last week. There were a few interesting events like for example the announcement of th...

51 views 0 6
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