Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-12645

NullPointerException when creating a board with Java API

    XMLWordPrintable

Details

    • Bug
    • Resolution: Support Request
    • Medium
    • None
    • None
    • None
    • None

    Description

      I try to create a Kanban or Scrum board programmatically using JIRA Software Java API. I use this code:

      String boardName = "B1";
      Long filterId = 10001L;
      ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
       
      RapidView rv = RapidView.builder().name(boardName).owner(user.getUsername())
              .savedFilterId(filterId).cardColorStrategy(CardColorStrategy.ISSUE_TYPE)
              .swimlaneStrategy(SwimlaneStrategy.EPIC).showDaysInColumn(false)
              .sprintMarkersMigrated(false).sprintSupportEnabled(false).build();
      RapidViewManager rvManager = new RapidViewManagerImpl();
      ServiceOutcome<RapidView> so = rvManager.create(rv, user, RapidViewPreset.KANBAN);
      

      Unfortunately I get NullPointerException:

      java.lang.NullPointerException
          at com.atlassian.greenhopper.manager.rapidview.RapidViewManagerImpl.create(RapidViewManagerImpl.java:187)
          at com.atlassian.tutorial.helloworld.MyTestServlet.doGet(MyTestServlet.java:92)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
              ...
      

      I tried passing RapidViewPreset.SCRUM, calling ...builder().id(null)... and passing other values to builder methods. The result is always the same, i.e. NPE.

      As I call all the methods of the rapid view builder and I cannot find any property which I should set yet, I suppose it is a bug in the RapidViewManagerImpl class.

      Attachments

        Activity

          People

            Unassigned Unassigned
            65a23747dce0 Michał Majcher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: