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,555,367
Community Members
 
Community Events
184
Community Groups

When writing User Macros I find myself forced to hardcode the Application link!

When writing a User Macro to visualize/access information from for example JIRA in confluence I use Ajax calls through the application link:

confbase = AJS.Confluence.getBaseUrl();
confproxy = "XXXXX";
jirabase = "https://xxx.yyy.net";
jQuery.ajax({
url: confbase+"/plugins/servlet/applinks/proxy?appId="+confproxy +"&path="+jirabase+"/rest/api/2/search?jql="+"$paramJQL"
type: "GET",
dataType: "json",
}).done(function(data) {
...
}

I am forced to hardcode the jirrabase and the proxy!

As a admin in the system I'm able to:

//
// Get a list of all application link configured in Confluence
//
/*
jQuery.ajax({
url: confbase + '/rest/applinks/1.0/listApplicationlinks.json',
type: "GET",
dataType: "json",
success: function(data) {
AJS.log("Yes!");
}
}).done(function(data) {
//
// Iterate over a list of application links
// search for Jira application link
// search in Jira application link found
//
jQuery.each(data.list, function (i, v) {
if (v.application.typeId == 'jira') {
confproxy = v.application.id;
jirabase = v.application.displayUrl;
}
})

I guess there is a security problem letting all users access this REST API?

Is there some other solution to this problem? 

I've had some previous problems with JQuery and the proxy, most of them resolved by now - Thank you all! The remaining problem is to use PUT (Creating or Modifying issues in JIRA from Confluence) - Yes I know there are plugins, but I want total control.

1 comment

If I'm not an admin I get:

{"message":"Only an admin can access this resource.","status-code":401}

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events