Automation for creating a URL link from a custom field

Mika Barnett-Ohori September 3, 2024

 

 

I want to create a custom URL from a field someone enters from a custom field. If the custom field (labeled Rule ID) is entered as 1000. I want the automation to populate a certain website (format would be something like: https://website.com/1000/fakewebsite) where the 1000 could be any number. How do I go about creating this automation in Jira?

 

Custom field entered (Rule ID) = 1000

then it auto populates a website = https://website.com/1000/fakewebsite

2 answers

2 accepted

0 votes
Answer accepted
Ashok Shembde
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.
September 3, 2024

To create an automation rule in Jira that generates a custom URL based on the value of a custom field (e.g., "Rule ID"), follow these steps:

Steps to Create the Automation Rule:
Ensure You Have the Custom Field

Make sure the custom field (e.g., "Rule ID") is already created and available in the issue types where you want to use this automation.
Go to Automation Rules

Navigate to your project in Jira.
Go to Project Settings > Automation > Create Rule.
Set the Trigger

Choose a trigger that suits your needs, such as Field Value Changed or Issue Created, depending on when you want the URL to be generated.
Add a "Create Variable" Action

Use the Create Variable action to store the custom field value. Name the variable something like ruleId.
Set the variable to the value of the custom field:

Smart value: {{issue.customfield_1000}}
Replace customfield_1000 with the ID of your "Rule ID" custom field.
Add an "Edit Issue" Action

Use the Edit Issue action to populate another custom field where the generated URL will be stored.
Set the field's value using the following smart value:


https://website.com/{{ruleId}}/fakewebsite
This will replace {{ruleId}} with the actual value entered in the "Rule ID" field (e.g., 1000).
Save and Activate the Rule

Save the automation rule and activate it.
Example:
If the "Rule ID" field is set to 1000, the rule will automatically generate the URL https://website.com/1000/fakewebsite and populate the specified custom field with this URL.

Testing:
Create or update an issue where the "Rule ID" field is populated.
Verify that the URL is correctly generated and stored in the custom field as specified.

Mika Barnett-Ohori September 12, 2024

thank you!

0 votes
Answer accepted
Jovin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2024

Hi @Mika Barnett-Ohori 

In terms of storing this value on the ticket you could use an automation rule such as below:

  • Trigger: Field value changed
    • Field: Rule ID
    • Operations: All
  • Condition: Issue field value
    • Field: Rule ID
    • Condition: IS NOT EMPTY
  • Action: Comment issue

You could replace the action with "Edit issue" to put this into another field called "URL" or something else.

In terms of creating a website, you'd be looking at WebHooks and you'd need to discuss with your website vendor etc. on how this would work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events