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,463,603
Community Members
 
Community Events
176
Community Groups

Mention directly from jira to slack

Edited

Hi, I am trying to automate Jira to mention users directly in Slack.

I used my Jira account for creating the API token (I am an admin).I'm using Python 3.9.6 and when running the sync.py script I found  here: https://community.atlassian.com/t5/Automation-articles/Mention-someone-directly-in-Slack-via-Jira-Automation/ba-p/1528605 

I get the following errors: 

INFO:root:Looking up 18 users in Jira server: https://chronosit.atlassian.net
Traceback (most recent call last):
File "C:\Users\Oana\slack_jira_sync\sync.py", line 225, in <module>
account_id = jira.get_user(email)
File "C:\Users\Oana\slack_jira_sync\sync.py", line 44, in wrapper
return func(*args, **kwargs)
File "C:\Users\Oana\slack_jira_sync\sync.py", line 137, in get_user
self._wrap_error("Failed to call search API.", response)
File "C:\Users\Oana\slack_jira_sync\sync.py", line 94, in _wrap_error
log.error("{} [{}] {}".format(error_message, response.status_code, response.json()))
File "C:\Users\Oana\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Oana\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Oana\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Oana\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

 

 

There must be somethig wrong I'm doing here .For the $APIKEY  I used the label from the token I have created.Is  this correct?

 

 Update : the value of the $APIKEY must be the value of the token created in Jira.Issue solved

1 answer

I think I understand what you're asking?  If by label, you mean what you called the key, that shouldn't work.  You'll have to use the value that was generated and shown once. 

Also, I don't know if it applies to your situation, but sometimes I can use that API key as-is, other times I have to Base64 encode it.  I believe calling the REST API requires encoding it.

Thanks, problem solved :)

Like Erin Quick-Laughlin likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events