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

Atlassian Connect Add-On Web Section Location

Kevin Poole
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.
August 5, 2014

I am attempting to place a new "Web Section" on my "View Issue Page" in JIRA via an Atlassian Connect Add-On.

I read (https://developer.atlassian.com/display/JIRADEV/View+Issue+Page+Locations) that the way to add a new web section here was via defining the location as "opsbar-operations," but the example given on the "Web Sections" page (https://developer.atlassian.com/static/connect/docs/modules/jira/web-section.html) from the "Atlassian Connect" documentation, shows a "." notation for location such as "com.atlassian.jira.plugin.headernav.left.context". Therefore in my atlassian-connect.json file I specified location as "opsbar.operations" instead of "opsbar-operations" but in the end neither notation seemed to reveal my Web Section.

Compiled onto this issue, once I have my new Web Section, I would of course want to populate it with new Web Items, but can't find any information on how address custom locations from the atlassian-connect.json file.

My atlassian-connect.json file is as follows:

{
	"name": "Web Section Test",
	"description": "Testing Web Section Placement",
	"key": "com.example.myaddon",
	"baseUrl": "http://localhost:8000",
	"vendor": {
		"name": "Example, Inc.",
		"url": "http://example.com"
	},
	"authentication": {
		"type": "none"
	},
	"apiVersion":1,
	"modules": {
		"webSections": [
			{
				"location": "opsbar.operations",
				"weight": 1,
				"key": "my-web-section",
				"name": {
					"value": "My Web Section"
				}
			}
		]
	}
}

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Kevin Poole
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.
August 5, 2014

It does not seem to be possible to add ones own drop down menu in the View Issue Page of JIRA, however, to add your own section to the "more" drop-down menu and have it be the top section of said menu, the following code modified to your needs should suffice:

{
	"name": "Web Section Test",
	"description": "Testing Web Section Placement",
	"key": "com-example-myaddon",
	"baseUrl": "http://localhost:8000",
	"vendor": {
		"name": "Example, Inc.",
		"url": "http://example.com"
	},
	"authentication": {
		"type": "none"
	},
	"apiVersion":1,
	"modules": {
		"webSections": [
			{
				"location": "opsbar-operations",
				"weight": 11,
				"key": "section-key",
				"name": {
					"value": "Section Name"
				}
			}
		],
		"webItems":[
			{
				"location": "section-key",
				"name": {
					"value": "Menu Item Name"
				},
				"key": "menu-item-key",
				"url":"http://www.google.com"				
			}
		]
	}
}

Kevin Poole
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.
August 5, 2014

The code belongs inside of the "atlassian-connect.json" file

0 votes
seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2014

Two comments here:

  1. Web-item/web-section locations are static, and they should not be changed. Don't replace "-" with ".", as it will not work. There is certainly some inconsistency in JIRA's extension here...
  2. Web-sections are web-item groupings. You will need to create a webItem with location "my-web-section" (the key of the websection you created).
Kevin Poole
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.
August 5, 2014

Thanks for the clarification.

I made the changes and was able to get it to appear in the "more" menu, as its own "section" (merely defined by the gray lines in the drop down menu).

I figured out that the web section wasn't displaying without having any web-items (I suppose that should have been obvious).

Getting it to display in the "more" drop down though was not my original intent. My hope is to create a new button similar to the "more" drop down button that says something like "Processing", and then have web items within that new drop down that say things like "Analyze","Parse", etc.

By setting the weight of my web-section to 1 I was able to displace the "assign" button into the "more" drop down but this is not ideal considering the centrality of the "assign" functionality.

TL;DR - Is there not a way to define an entirely new drop-down button in that location of the view issue page?

seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2014

Without having tried, you might need to:

  1. create a web item with location "operations-top-level", key "foo"
  2. create a web section with location "foo", key "bar"
  3. create a web item with location "bar"

I think the tricky bit is finding the web-section's location. It might be "foo" or it might be "operations-foo". Not sure sorry.

Kevin Poole
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.
August 5, 2014

Well thanks for at least answering and telling me that you aren't sure.

I did attempt your suggestion and it just placed it into the existing "more" drop down. I'm thinking that the functionality to add ones own drop down menu on the view issue page is not an option excluding possibilities of a deep-dive into the source markup.

Kind of weak on the part of Atlassian, but perhaps it will become available in future releases. For now I will settle for a seperate section in the "more" dropdown.

TAGS
AUG Leaders

Atlassian Community Events