Forums

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

How to auto-update Summary?

Preston Warden
Contributor
April 2, 2020

I have the Automation for JIRA downloaded on our server. I am trying to get it set up to where a summary field is created automatically to ensure that the field is consistent across all issues. 

 

Here is the link I found that I cannot figure out how to use.

https://community.atlassian.com/t5/Jira-Software-questions/How-to-update-the-Summary-field-by-appending-text-using/qaq-p/929877

 

I would like the summary to update with the following fields in the format as shown:

 

{{Program Name}} &" "& {{Lot Number}} & " (" & {{Work Authority}} & ")"

 

I know the language is incorrect on that coding. I am very new to JIRA and am trying to figure it all out.

2 answers

1 accepted

0 votes
Answer accepted
Kian Stack Mumo Systems
Community Champion
April 2, 2020

Hello Preston,

Are the "Program Name" field,  "Lot  Number", ect custom fields being filled out?


If so, do the following

  1. Create a new automation rule. You'll need to pick the trigger you want to  run. For something like this, it sounds like you might want it to run when the tickets are being created.
  2. Add a condition to limit when the rule is run -   If you don't want the rule to be executed for every ticket created, make sure to enter a condition so that it only executes for the tickets you want.  For example, maybe you only want it to execute if the ticket has values for all three of those fields.
  3. Add an "Edit Issue" action. Choose the summary field & insert the following:
    {{issue.program name}}  {{issue.Lot Number}} ({{issue.work Authority}})

This should get you what you want!

Thanks,

 

Kian

Preston Warden
Contributor
April 2, 2020

Hello Kian. Yes they are custom fields. I took out lot number for the immediate time being, but below are screen shots of what I am seeing.

 

2020-04-02 09_54_41-Create Issue - Jira.png2020-04-02 09_55_10-Project automation - Jira.png

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Preston,

This is because you need to have a summary when you submit the ticket. If you are setting it via an automation rule, it doesn't matter what you put, the automation rule will override it with the value you've specified. 

 

If you want the value populated WHILE you are filling out the form, automation for Jira cannot do that. Instead, you'd have to look at something like behaviors which come with the Scriptrunner plugin. That requires actual groovy scripting, so it's a bit more complex.

 

Thanks,


Kian

Preston Warden
Contributor
April 2, 2020

Awesome. I did just try it and it works. I would like it to populate as I go, but I think Script Runner costs if I remember right.

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Scriptrunner does have an additional cost, it depends on your license size!

Preston Warden
Contributor
April 2, 2020

Sure. We will research that a different time.

 

Thank you.

Preston Warden
Contributor
April 2, 2020

How could I set it to where the summary field cannot be edited by users after the fact?

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Preston,

The best way to do this would be to set up different screens for the Create and Edit operations.

The create screen must contain summary, but you can remove it from the view people get while editing, effectively preventing them from editing the summary.

 

For more information about accomplishing this, please refer to the following resources:

https://confluence.atlassian.com/adminjiraserver073/configuring-issues-861253230.html

https://confluence.atlassian.com/adminjiraserver073/associating-a-screen-with-an-issue-operation-861253437.html

Preston Warden
Contributor
April 2, 2020

Thank you. You seem very knowledgable and I appreciate it. I am trying to get the duplicate automation to work where it will automatically close duplicate issues, but cannot get it to work. 

Preston Warden
Contributor
April 2, 2020

Actually I just noticed an issue. 

 

Here is the formula I put in, once I created lot number.

 

{{issue.program name}}  Lot {{issue.Lot Number}} ({{issue.work Authority}})

How can I set it that if "Lot Number" is empty, do not show "Lot", but show {{issue.Manufacturing Number}} 

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Preston,

Automation for Jira isn't smart enough to handle conditions like that in a single statement. Instead, I'd recommend writing an IF/Else block:

IF Lot number is not empty

{{issue.program name}}  Lot {{issue.Lot Number}} ({{issue.work Authority}})

Else

{{issue.program name}} {{issue.manufacturing Number}} ({{issue.work Authority}})

 

As for the closing of the duplicates, I  guess it depends on how you define a duplicate. Are you saying if a ticket with the same summary is created, automatically close that new ticket?

Preston Warden
Contributor
April 2, 2020

Yes I would like to close duplicates based on the summary. If it matches, it needs to be flagged.

 

Also, I will try and figure out how to do the if/else block. 

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Preston,

 

Given that you are automating all of your summaries based on the custom field values, would it be more accurate to say that if two tickets have the same values for all the custom fields, the one just created should be closed?

Thanks, 

Kian

Preston Warden
Contributor
April 2, 2020
If {{issue.Lot Number}} is not Null then
{{issue.program name}} Lot {{issue.Lot Number}} ({{issue.work Authority}})
Else
{{issue.program name}} {{issue.Manufacturing Number}} ({{issue.work Authority}})
End if

Here is what I inputted in the "Advanced field" but it didn't work. It stated Error Parsing Additional Fields. 

Preston Warden
Contributor
April 2, 2020

Yes that statement would be correct. If all custom fields are the same, it needs to close.

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Use a simple condition, it has the ability to do an "is empty" check for a custom field.

 

As for the other part, try this:

  1. Before you set the summary, perform a related issues condition check,  using the JQL option.

Screen Shot 2020-04-02 at 10.00.51 AM.png

Essentially you would be checking if there is another ticket already matching all the values entered for this ticket. If so, transiton to closed.

 

If not, proceed with the rest of your automation.

Preston Warden
Contributor
April 2, 2020

So I can't find how to do the if/Else and If Then. From what I can tell, that is only available in the Pro Series. Is that correct?

Kian Stack Mumo Systems
Community Champion
April 2, 2020

I see. I didn't realize you were using the free version.

It's nowhere near as nice to do with the free version, but it is possible. You would need to split up the rules into three separate ones.

The first would check if there are any duplicates. If there are, it would close the ticket.

The second and third would the be other conditions we discussed. So one rule would say "If the Lot Number" is populated, do this, and the other would check if the Manufacturing Number is in existence.

 

Not as easy, but it is possible to do.

Preston Warden
Contributor
April 2, 2020

I also tried out the transition Close Duplicates, and I created two duplicates, but nothing. Did I do something wrong?

 

Action details:

JQL condition

No subsequent actions were performed since JQL condition did not pass due to error running JQL:"(key IN (PST-17) AND ("Lot Number" = 5 AND "Work Authority" = 4306))" - The operator '=' is not supported by the 'Lot Number' field., The operator '=' is not supported by the 'Work Authority' field.

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Your field types must be text, not number.

Try with the operator ~ instead.

Preston Warden
Contributor
April 2, 2020

That worked. I am going to set it up to create a comment and state "Status changed to close due to duplicate issue." Is there a way to have it insert a link to the duplicate?

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Preston,

I'm not sure that the free edition has that capability. 

Thanks,

Kian

Preston Warden
Contributor
April 2, 2020

Well for now it is working well. 

 

Thank you for all of your help. I will more than likely post more questions later.

Preston Warden
Contributor
April 2, 2020

Hi Kian. I went through and created all of the issues I needed to (about 80), but I wasn't going back to check that everything was running properly. It closed all of the orders I was working on and subsequently added the comment for duplicates. It is doing it to all of them, regardless of the values inputted.

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Preston, I'm sorry that it closed them all. My best guess is that the JQL picked up itself, IE, when it ran the condition, it returned itself and closed it.

 

I'd add onto the condition a check to make sure the issue key isn't the current issue.

You  should  be able to do a bulk change to reopen the tickets. https://confluence.atlassian.com/jirasoftwareserver/editing-multiple-issues-at-the-same-time-939938937.html

Preston Warden
Contributor
April 2, 2020

Accidents happen. I will get this added.

Preston Warden
Contributor
April 2, 2020

Is there a way to break up Software users for a specific project (Production Tracker) so that only certain ones can edit fields?

Kian Stack Mumo Systems
Community Champion
April 2, 2020

Yes, you can change permissions to allow only specific users to edit tickets.

Please review the documentation on permissions. https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html\

 

Thanks,

Kian

Preston Warden
Contributor
April 2, 2020

Thank you for all of your help. I am going to try and get the key issue condition to work.

Preston Warden
Contributor
April 2, 2020

What would be the best way to write that in for the key issue?

"Lot Number" ~ {{issue.lot number}} AND "Work Authority" ~ {{issue.Work Authority}} AND "Key Issue" != {{issue.key issue}}
Kian Stack Mumo Systems
Community Champion
April 3, 2020

Preston,

I'd encourage you to read up on the documentation provided by Atlassian about the smart values. I think in the long run that would be beneficial for you.

"Lot Number" ~ {{issue.lot number}} AND "Work Authority" ~ {{issue.Work Authority}} AND "issueKey" != {{issue.key}}
0 votes
Preston Warden
Contributor
May 27, 2020

@Kian Stack Mumo Systems 

 

I was using the below and it was working, but a few weeks ago this code stopped working. to the best of my abilities, this should still be working. Can you help?

 

{{issue.program name}} {{issue.Manufacturing Number}} ({{issue.work Authority}}) 

 

The names haven't changed but it is responding with the Manufacturing Number being null (even though there is data). 

Kian Stack Mumo Systems
Community Champion
June 1, 2020

Hey Preston,

Can you show us a screenshot of the results of your code, along with the configurations of the automation rule? Is it just Manufacturing Number that isn't working?

Thanks,

Kian

Preston Warden
Contributor
June 1, 2020

image.pngimage.png

Kian Stack Mumo Systems
Community Champion
June 1, 2020

Preston,

 

According to this, your automation rule isn't running since it doesn't match the conditions you've set out. IE - Lot Number is not Empty. It won't perform the automation you have.

Suggest an answer

Log in or Sign up to answer