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,460,380
Community Members
 
Community Events
176
Community Groups

Assigning organizations field based on customer that raised the query

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.

2 answers

1 accepted

0 votes
Answer accepted

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!

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. 

Does this still work for you? I did try it today and I cannot get it to work. The Organizations Field stays empty.

I did find a solution:

{% set result = "/rest/servicedeskapi/organization?accountId=:issue" | callJira(params={"issue":issue.fields.reporter._accountId}) %}
{{ result.values[0].name }}

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events