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
Community showcase
Posted yesterday in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

45 views 2 2
Join discussion

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