I want an issue summary to contain custom field information but with a little logic.
Stick with me here...
The issue will have one of two potential date fields filled in depending on other options in the issue. So for ease we will call them issue.CustomDate1 and issue.CustomDate2
I want the issue Summary to have some text and then insert CustomDate1 -OR- CustomDate2, whichever field has a value as the other will be null.
How would that be scripted?
if one is always empty try just including both...
Action - edit issue - Summary
{{issue.summary}} - {{issue.due date}} - {{issue.other date}}
this will append both dates but if say the first is "none" then you get this...
this is my summary - - 2202-02-23
as an example
On a low level, this could work. We would just a random space that nobody will realize except me.
As someone who likes easy solutions, this appeases me 😎
As someone who is OCD and is unnecessarily focused on formatting, this annoys me 😑
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...to what Jack suggests:
I recommend #2 as *always* may be difficult to enforce/remember.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add an if/else condition to check one of your date fields for empty and if empty then use the other date, if not the use that date.
now what I find worrisome is the fact that you could have a date in both so I think you need to consider this in your automation to help flag this apparent error condition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes as @Bill Sheboy says You can omit the delimiter. I left it in thinking it might be nice to be able to identify which date was applied based on placement in summary.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy So I agree and would love to use conditional logic for this task. I had reviewed that article you linked numerous times before posting here and I don't understand how I would script it out.
I know it's possible, just don't know what syntax to use. There's no clear example on that article referencing my exact situation from what I can tell.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On that page, please take a look at the example for the exists() function to do what you ask: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/#exists
That function checks if a field has a value, and then uses it when present.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh! Thank you for pointing me to that specific function. I think I have an idea of how to script this now... time for testing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At a high level it would go like this:
by using the {{issue.Summary}} smart value, the automation repopulates the existing summary. Then by added {{issue.duedate}} (or in your case, one of your custom date fields) you get the date after the Summary.
You could simply do a rule for each field or use an If/else condition.
You can also format the date to best suit your needs. See Jira smart values - date and time | Cloud automation Cloud | Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So this Summary is being filled in on a linked issue during a Create Issue action in an automation flow. Hence why I was looking for conditional logic in smart values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That can be done @David Quiram via branching and some smart values. Best you state your complete use case so we can provide more focused responses for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, hopefully this helps clarify everything for you.
Automation will check an issue on creation and create a linked issue in another project if it meets specifics requirements. That is all working just fine.
On the created linked issue, I would like the Summary to include some text and either CustomDate1 or CustomeDate2, whichever field has a value as the other field will be null.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case @David Quiram it will be very much as @Jack Brickey has suggested, but as part of the creation of the linked issue:
Action - Create issue
Summary: {{triggerIssue.summary}} - {{triggerIssue.SomeOtherText}} - {{triggerIssue.due date}} - {{triggerIssue.other date}}
Resulting in something like:
this is my summary - this is the other text - - 2202-02-23
Obviously you need to define where from the trigger issue you are getting the extra text from. And as discussed here, you can format the summary field to your requirements and add if/else or any other conditional logic required.
But by using the triggerIssue smart values in the creation of the linked issue, as generated by your currently working rule using the "Issue Created" trigger, should see the results you are after in the summary field of the linked issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.