It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Atlassian Connect Add-On Web Section Location

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

1 vote
Answer accepted

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"				
			}
		]
	}
}

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

0 votes
Seb Ruiz Atlassian Team Aug 05, 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).

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 Ruiz Atlassian Team Aug 05, 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.

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Off-topic

Friday Fun: Virtual dance party!

Do dance parties help you relieve stress? How about *virtual dance parties*? My team holds virtual dance parties to brighten the mood of a tough day or celebrate an upcoming weekend.  Want t...

147 views 20 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you