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

How add issue information via DOM manipulation after Create Issue?

Carsten A.
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.
January 8, 2013

Hi there,

I have a custom project tab where I list issues kind of custom ordered showing a few issue information (Icon, Key, Summary, Status, FixVersion, Assignee). When I create a new issue successfully, I want to add it via DOM-manipulation to my tab (according to my order).

I don't realy know how to get there:

  • Do I have the add a event listener? How do I get the issue and its information "on the screen"?
  • Do I have to add a javascript to the issue creation page executing when I click the create button? But how do I know the issue was successfully created?

Can anybody provide further guidance to solve this?

Thank in advance.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Carsten A.
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.
March 26, 2013

I "dirty-hacked" a little bit:
I store all the field values entered when the Create button is clicked. Since Jira "reloads" the project-tab I'm on via the click-Event, I added a listener. This listener is looking for the success-message to get the issue-key of the just created issue and prevent the click (and the tab reload).
Then I create my dom-object with the issuekey and the stored field values and add it to the correct position in dom.

It's a reeeeaaaally dirty hack, but it does wha it's supposed to do.

So thanks for all your help. If you have better solutions, feel free to share them with me. :)

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2013

I'm a little confused - javascript runs on the client, listeners run on the server, and there's no interface between the two for listeners. So I don't think your listener is providing anything for the front-end to work with on the client. I don't think you can do javascript this way.

Carsten A.
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.
January 31, 2013

Sorry. I just did not really made myself clear enough.
I just mixed two approaches to the point of misunderstanding. I edited the question and I hope you can now understand where I am trying to get.

0 votes
twong_atlassian
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.
February 1, 2013

If I'm understanding you correctly, you want to be able to dynamically update a view of some filter whenever something happens (e.g. a ticket is created).

if so, I think this is what you're looking for:

https://developer.atlassian.com/display/JIRADEV/JIRA+Webhooks+Overview

Carsten A.
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.
February 1, 2013

Not really.

First of all I should say that we're still on JIRA 5.0.2 and Webhooks are only available since 5.2.

Second, I need to provide this functionality via a custom plugin, which will be installed on more than one instance.

Renjith Pillai
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.
February 1, 2013

I guess we all are still confused what you are trying to achieve.

Is it that you have your own tab in the project page (as in https://confluence.atlassian.com/display/JIRA/Browsing+a+Project) and once the user creates a new issue using 'Create Issue' button on the right top corner, you want to refresh your page automatically with the new issue content as well?

Carsten A.
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.
February 3, 2013

Exactly. Ok. Just to make it more clear:

I've written a jira plugin, which adds a "new" project tab (like shown here: Browsing a Project's Issues). On this tab/page I can select a version of the project. After selecting a version all issues related to that versions hierarchy (VersionAssociation via Greenhopper) are shown kind of hierarchical with a few issue informations. This is for project planning and workflow overview.
Now I want to be able to use jiras "Create Issue" and want to add the created issue to the page without the need to reload/refresh the page (just DOM manipulation). This should be achieved with the plugin itself.

There I'm stuck. When I write a listener I don't know howto "call" a dom manipulation from that. And when e.g. adding custom javascript to the submit of the CreateIssue dialog, I don't know how I should check if the issue was created successfully or not. It would be enough to "get" only the issues created by the user currently viewing the tab. I don't need to "get" the all the other issues created in the meantime by other users.

TAGS
AUG Leaders

Atlassian Community Events