You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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 =)
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
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
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.