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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
I'm having some issues around trying to improve the following code i have in JMWE.
issue.fields["Reporter"] isInOrganizations ()
The idea is that the customer will report the ticket, and then the organization that they are from, will be automatically assigned based on the customer/organization setup. Now that we have tons of organization, a normal if/else check doesn't seem ideal? Just wondering if there is a better method out there?
Thank you.
Hi Patricia,
unfortunately, Jira Service Desk doesn't expose a REST API to access the Organizations to which a Customer belongs. And iterating over each Organization to check whether the customer belongs to it is not a good idea either, as you will quickly reach your Jira Cloud REST API "quota".
I have created https://ecosystem.atlassian.net/browse/JSDECO-125 to request this feature from Atlassian, but don't hole your breath!
Thank you David. I was hoping that we would have a workaround to this. This doesn't make things easier for us unfortunately. Also thanks for the feature request!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update: for Cloud users
I have recently been using JMWE and by accessing the service desk API and JMWE this is now possible.
Go to your JMWE app and select: Event-Based Actions and select new
Trigger: issue created
Project: I have our main service desk selected
Select Add Post function
Set Target issue: Current issue
Add Field: Organizations
options: set only if empty
Value:
{{"/rest/servicedeskapi/organization?accountId=:issue" | callJira( params={"issue":issue.fields.reporter._accountId})}}
Run as add on user and the save.
Save again and then it should set the organization based on the reporters account ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does this still work for you? I did try it today and I cannot get it to work. The Organizations Field stays empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did find a solution:
{% set result = "/rest/servicedeskapi/organization?accountId=:issue" | callJira(params={"issue":issue.fields.reporter._accountId}) %}
{{ result.values[0].name }}
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.