Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Transition based Automation to clear fields

Prabakaran Parthiban July 12, 2022

Hi 

I have two transitions called "Expire Quote" and "Record Quote" for a status, I'd like to do a schedule automation like when the issues move from the "Expire Quote" transition the action would be some set of custom fields has to be cleared. If the issue moves from "Record Quote" the field shouldn't be cleared. 

I tried with Jira Automation/JWT automation but no luck. 

Is there a way to do this with "Script runner"/ the automations? 

 

Thanks,

Prabhu

2 answers

1 vote
Mark Segall
Community Champion
July 12, 2022

Hi @Prabakaran Parthiban - To confirm, you're wanting to perform action when it transitions from one of those two statuses?  If so, automation doesn't quite work that way.  You'd want to instead perform the action on the destination status(es).  You'd use the Issue Transitioned trigger and it would look something like this:

  • FROM: Expire Quote, Record Quote
  • TO: All possible destination statuses

If it's possible that both statuses can transition to the same destination statuses, the easiest approach would be to set up separate rules for each.

Prabakaran Parthiban July 12, 2022

Hi @Mark Segall Thanks for the suggestion. 

I've a question, How does the schedule work here? This should happen automatically at a particular time.

I don't see the Issue Transitioned trigger on the trigger section. How to configure this? 

Screenshot 2022-07-12 223108.jpg

Mark Segall
Community Champion
July 12, 2022

Interesting - It looks like you only have DevOps triggers in your automation (there are several more specific to Jira issues).  Does your server instance have this automation add on installed?

https://marketplace.atlassian.com/apps/1215460/automation-for-jira-data-center-and-server?tab=overview&hosting=datacenter

Prabakaran Parthiban July 13, 2022

No, we don't have Automation for Jira. Is there any other possible way to do with JWT Automation/ Scriptings? 

Thanks! 

Mark Segall
Community Champion
July 13, 2022

Unfortunately, JWT is not my strength so I'd have to defer to the community.  The link I shared above is created by Atlassian and is free.  I would strongly recommend it.

0 votes
Prabakaran P July 20, 2022

I installed the "Automation for Jira" app to my test instance, but I couldn't configure it. 

trigger.jpg

Prabakaran P July 20, 2022

I tried with the transition based trigger, but not sure how this works on a schedule. This I done it through project not on the workflow transition. PHOTO-2022-07-20-14-46-49.jpg

Mark Segall
Community Champion
July 20, 2022

This will be specific to your project.  If you click on Rule Details, there's a section for project scope where you'll see which project(s) are in scope.  So, if only your project is selected, it looks like you're establishing a rule that triggers when the issue transitions from QUOTE DELIVERED to CLOSED with an action of updating the field values for these fields:

  • Business Fee Recurring
  • Business Fee Non-Recurring
  • Development Hours Estimate
  • Quote Result
  • Business Waive Fee Reason field values

If this is your intent, it should work as designed.  If not, please provide a bit more context into what you're trying to automate.

Prabakaran P July 21, 2022

How does this work on a particular time?  For example, I want to clear those fields every Friday night, around 11PM.   

Mark Segall
Community Champion
July 21, 2022

You would need to change your trigger to run on a schedule. 

Can you please provide more detail on what you're trying to achieve for your overall goal with this automation (e.g. When this occurs, and x conditions are met, I want automation to do this)?  This would help give a broader picture so we can help you better.  

Prabakaran P July 25, 2022

I have two transition for a status Closed, the names are

  • Record Quote
  • Clear Quote 

If an issue moves via Record Quote transition no action is needed. 

If an issue moves via Clear Quote I want an action that a set of fields to be cleared after 24hrs. 

Please let me know if you have any questions. 

Thanks! 

Mark Segall
Community Champion
July 25, 2022

Ok - Automation cannot trigger off a specified transition. So, I would recommend adding a post function to the Clear Quote transition that adds a label, component, or populates a custom field. 

Then update your trigger to something like this (I'm using a label called clearQuote for my example):

  • TRIGGER: Scheduled (Daily) with following JQL
    • Status = Closed AND status CHANGED BEFORE -1d AND status CHANGED AFTER -2d AND labels IN (clearQuote)
Prabakaran P July 26, 2022

I Installed the Jira Automation addon to my test instance. But I don't see any other Jira triggers on the transition. 

Would you please help me to configure it? 

Thanks! 

Mark Segall
Community Champion
July 26, 2022

It'll look something like this2022-07-26_05-55-10.jpg2022-07-26_05-56-39.jpg

Suggest an answer

Log in or Sign up to answer