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

Launching web action from Java client

Andrey Pechnikov May 25, 2015

Hello all!
I'm developing a service for JIRA (in Groovy or Java). I have a strong need to comunicate with other add-onn.
So I need to launch a web action from Java and get the result of the action
So i tried:
1) To send get and post requests - needed XSRF key
2) added XSRF key to the params of the request - as a result got error (invalid key)
3) added cookies to my request - still getting error, the same one
4) No-XSRF param in the request cause NPE on the server because currentUser() is used in doExecute method 

All that I done with basic authentication.

As a result I emualted accessing to doDefault method (to get cookies and XSRF key), and then to doExecute (to launch the action) but still nothing happened.

Could you plpease help to me?
 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Midori
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2015

Hmm, this sounds very cumbersome and fragile.

Cannot you call the action in the other plugin with a plain vanilla Java method call? Or, assuming that that action delegates to some business tier object, cannot you call the method on the business object?

Andrey Pechnikov June 10, 2015

Thanks for response, Ferenc! Sorry, i lost a notification about an answer. Sound interesting, but how can I another plugin as a dependecy to my own?

TAGS
AUG Leaders

Atlassian Community Events