Forums

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

Post functions on jira SM

Fatima AALLA
Contributor
May 8, 2024

Hello,

Due to the limit of 5000 executions in automation rules, we try to minimize  using post functions,

I need to fill a date field on a transition via a post function, but need to do this only if this field is empty (need to catch the first date of the transition) how to achieve that using post function?

Need also to comment on an issue using post function

any suggestions please?

Thank you!

4 answers

0 votes
Sergio García-Consuegra _Decadis AG_
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.
May 16, 2024

Hi @Fatima AALLA ,

 

I'm Sergio, a member of the support team from Decadis. We would like to propose you a solution using our app Jira Workflow Toolbox.

 

This requirement can be achieved using our post-function Update fields (by JWT). 

When you give a value to your field, you must select "Set field value manually" as the value for the field, and then use the following general expression:



%{dateTimeToString({system.currentDateTime}, "yyyy-MM-DD", "en_GB")}


At last, you can use the following Conditional execution at the end of the post-function configuration for only giving a value to this date field if it's empty:

%{issue.cfNNNNN} = null

 

Replacing NNNNN for your date custom field code.

 

Also, if you want to publish a comment, we have a post-function which will allow you to add that comment, which is our Add comment post-function.

 

If you are interested in these approaches and need more information, please, feel free to create a request in our Support Portal, to visit our documentation or to reply us in this thread.

 

Best regards,
Sergio

 

 

0 votes
Charlotte Santos -Appfire-
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.
May 14, 2024

Hi @Fatima AALLA

I’m Charlotte, a support engineer at Appfire and I’m here to help you.

Unfortunately, natively, you’ll not be able to do it the way you need to. In the app where my team works, Jira Misc Workflow Extensions, you can use the Set issue fields (JMWE app) post function to update the value of one or more fields only if the field is empty, for example:

Screenshot 2024-05-14 at 12.14.49.png

You just need to select the field that is going to be updated, then select the option "Set only if field is empty" and finally add the {{ now }} so that the date is set when the issue is transitioned to that particular status. Save it, publish the change and you're all set.

This is only one of the many functions JMWE offers, so, please feel free to contact our support if you have any questions about this function or about the app in general.

We'll be happy to help you! 😉

0 votes
Dick
Community Champion
May 8, 2024

Why not via a transition screen between statuses?

0 votes
Jack Brickey
Community Champion
May 8, 2024

Hi @Fatima AALLA , your first sentence seems incorrect. I think you are saying that you are trying to leverage Workflow Post functions to offset the reliance on Automation. In any event, back to your question. Could you not use the Field required validator accompanied with a transition screen requiring the user to enter a due date?

IMG_4049.jpeg

Jack Brickey
Community Champion
May 8, 2024

It seems that arbitrarily setting a due date via a post function is misguided. Would you not want the user to specify?

Fatima AALLA
Contributor
May 13, 2024

hello @Jack Brickey ,

thank you for your response, no what I need is the date when a transition occured for the first time, I need to fill this date in a custom field

Jack Brickey
Community Champion
May 14, 2024

There isn't an automated means of doing this within post functions OOTB. Here are options:

  • use a third party addon that extends the workflow capabilities to include conditional post functions.
  • use a transition screen and educate the team to enter the date only if the current field is empty
  • use Automation (but you said you don't want to do this)

Suggest an answer

Log in or Sign up to answer