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

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

Custom Plugin to generate task IDs

Hey,

I am attempting to create a custom plugin using a workflow post function which will operate when a task is created.  The idea is that the plugin will poll the current project, count the number of tasks that have been created this year, then populate a custom field with projectname-year-count.

I have been following the tutorial: https://developer.atlassian.com/server/jira/platform/creating-workflow-extensions/#part-2--create-the-workflow-post-function 

And I'm at the point where I need to deviate and I have no familiarity with the Jira API's at all.

How do I get a count of all issues created in a specific project in a set date range? I've been looking at the IssueManager class and can't find any way to supply a filter for an issue search.

P.S.

I don't want to use script runner, I want to learn how to make custom plugins so that we can implement some other post functions that will integrate with some of our other tools. 

1 answer

0 votes

The JQL "project = X and created > (start date) and created < (end date)" will answer the question for the list of issues created in a period, so you could use that in a search in your code.

Or you could use it directly in your reports, you don't really need to be coding to solve that problem.

But I'm not sure that your approach to getting this report is a good one.  Because the search I've given will answer your question on demand, there's no need for a counter field or running code to update it every time there's a new issue.  Plus, your custom field will exist on every issue and your report will still need to go do a search so it can find issues that have your ID set.

If you're trying to report on issues raised during a period, I would recommend a quick look at the built-in reports and gadgets, and then (assuming none of them are quite right) as a learning exercise, write your own gadget or report that does exactly what you need!

Suggest an answer

Log in or Sign up to answer
TAGS

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