Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

LP I'm New Here Mar 24, 2021

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 showcase
Published in Confluence

⚡️NEW Group for Confluence Cloud Admins

Calling all Confluence Cloud Admins!  We created a new Community Group to support your unique needs as Confluence admins. This is a group where you can ask questions, access resou...

112 views 2 9
Read article

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