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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,282
Community Members
 
Community Events
184
Community Groups

Channel shows as 'Unknown' when tickets created programmatically for brand new Issue Type

Hello,

I have the below .groovy script that would create a simple ticket. 

Executing the below script on Scriptrunner's Script console creates ticket for "IssueTypeID=10002"(Service Request with Approvals) with Channel set to "Jira" by default as expected.

When trying to execute the below script with a newly created "IssueTypeID=10701"(Approval task), the Channel is set to "Unknown".

Channel_Issue.png

Why would the Channel be set to "Unknown" for a brand new Issue type and be set to "Jira" for the existing issue types ?

On the other note, I do know how to set the request.channel.type="Jira" programmatically after creating the issue. But, I don't want to set it unless needed.

Any insight on why Channel would show as "Unknown" for brand new issue type ?

import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser

long projectId = 10201 //Project Id
//def issueTypeID = "10701" //Approval task (brand new issuetype)
def issueTypeID = "10002" //Service Request with Approvals (existing issuetype)
//def issueTypeID = "10001" // Service Request (existing issuetype)

ApplicationUser currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
IssueService issueService = ComponentAccessor.getComponent(IssueService)

def issueInputParams = ComponentAccessor.getComponent(IssueService).newIssueInputParameters().with {
setProjectId(projectId)
setIssueTypeId(issueTypeID)
setReporterId(currentUser.name)
setSummary("Test Summary")
setPriorityId("3")
setDescription("Test Description")
}

def validationResult = issueService.validateCreate(currentUser, issueInputParams)
assert validationResult.valid : validationResult.errorCollection

def result = issueService.create(currentUser, validationResult)
result.valid ? log.info("Ticket created: " + result.getIssue().getKey()) :log.info(result.errorCollection.errorMessages[0]);

1 answer

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 08, 2022

Hi @Anita Kalidoss 

Maybe you have to enter a value for the customer channel source. Please see below the documentation (or search for your JSM version)

https://docs.atlassian.com/jira-servicedesk/3.7.1/com/atlassian/servicedesk/api/request/CustomerRequestChannelSource.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events