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

Retrieving Slack connection token in Resources to be used in Listener with scriptrunner

Kamal Iqlaas Ismail June 6, 2023

I have setup a Slack connection using Resources.

How do i retrieve the token to be passed to a variable in a listener?

Asking chatgpt did not work as i think this is very specific question.

Was following this, noticed that it uses 

import com.onresolve.scriptrunner.slack.SlackUtil

but not sure the library have function to get the slack token.

Any pointers would be greatly appreaciated!

1 answer

Suggest an answer

Log in or Sign up to answer
1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 7, 2023

Welcome to the Atlassian Community!

Asking ChatGPT is almost always going to give you the wrong answer - it tends to tell you what you want to hear rather than the truth.

The library you've found will work, but you do need to test it with your code.

Kamal Iqlaas Ismail June 7, 2023

thanks @Nic Brough -Adaptavist- , i tested all the functions for the SlackUtil, but not sure there is a function to retrieve the token, as I read somewhere that would be flawed design. (chatgpt gave me that answer too)

 

Screenshot 2023-06-08 at 10.12.33 AM.png

for example, the function message already embeds the token inside, and we only need to reference which token to use by the name, as shown here

appreciate the response Nic!

TAGS
AUG Leaders

Atlassian Community Events