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

How to dynamically add web-items to agile board?

I have a section on agile board and want to dynamicaly add a web-items to it.

<web-section location="jira.agile.board.tools" key="custom-board-tool-section" weight="10">
        <label key="My Section"/>
</web-section>

I have tried to use a web-item-provider

<web-item-provider key="items-factory" name="Web Items Factory"
                       section="jira.agile.board.tools/custom-board-tool-section"
                       class="com.sample.impl.LinkFactory"
                       lazy="false"
                       weight="10"/>

with following code

package com.sample.impl;

import com.atlassian.plugin.servlet.PluginHttpRequestWrapper;
import com.atlassian.plugin.web.api.WebItem;
import com.atlassian.plugin.web.api.model.WebFragmentBuilder;
import com.atlassian.plugin.web.api.provider.WebItemProvider;
import com.sample.Utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class LinkFactory implements WebItemProvider {

    public Iterable<WebItem> getItems(Map<String, Object> map) {

        Map<String, String> names = Utils.getNames();
        final List<WebItem> links = new ArrayList<WebItem>();
        for (Map.Entry<String, String> entry : names.entrySet()) {
            String entryKey = entry.getKey();

            int weight = 10;
            links.add(new WebFragmentBuilder(weight += 10)

                    .id(entry.getValue())
                    .label(entryKey)
                    .title(entryKey)
                    .styleClass("")
                    .webItem("custom-board-tool-section")
//                    .webItem("")
                    .url(((PluginHttpRequestWrapper) map.get("request")).getContextPath() + "/secure/nnn")
                    .build());
        }
        return links;
    }

}

and this code does not add any web-item to my section.

Maybe somebody faced with similar problem and can help to solve it?

additional info : Jira version 7.1.1

Thanks in advance!

0 answers

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published yesterday in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

47 views 0 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you