Forums

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

Single line text field to Jira ticket

Alok Juneja
Contributor
August 25, 2023

Hi,

I have a Single line text field called "Feature Link", where I put the link to the feature. In the automation, I want to query that Feature that is in that single line text field custom field. However I have no success, since the api has just the name of the Jira ticket in "Feature Link" custom field. 

"Feature Link" is customfield_14135

Api call returns:-

"customfield_14135":"ALK-1350"

Do you have suggestion that how can I convert that text into Jira ticket and then query it something like this:-


{{issue.customfield_14135.issueType}}

 

Br,

Alok

 

 

1 answer

0 votes
Mark Segall
Community Champion
August 25, 2023

Hi @Alok Juneja 

Can you please confirm whether that custom field contains the issue key, issue link or the summary?  Depending, you could go a number of routes:

  • Key
    • Key = {{issue.customField_14135}}
  • Issue Link
    • Key = {{issue.customField_14135.subStringAfter("browse/")}}
  • Summary
    • Summary ~ "\"{{issue.customField_14135}}\""
Alok Juneja
Contributor
August 25, 2023

Hi @Mark Segall 

Custom field has Issue key.

Br,

Alok

Alok Juneja
Contributor
August 25, 2023

Hi @Mark Segall


Then the question is if I can query this key value. Don’t I need to save the key in some variable?

how is that possible?

br,

alok

Mark Segall
Community Champion
August 25, 2023

Can you please provide more detail on what you're trying to do?  Is this for Jira Automation or is it for an API call? 

If for Automation, what's triggering this and what action are you trying to perform?

If this is for API, I'll need to defer to someone else in the community with more coding experience.

Alok Juneja
Contributor
August 25, 2023

Hi @Mark Segall

my apologies for not providing what I am trying to achieve and why.

I am working in Jira automation.

i am making a Feature->Story link, since Jira does not provide one. This way I want Epic->Feature->Story

I have created an issue type “Feature”.

I have the custom single line text “Feature Link”.

Then I have link type of “issues in feature” and “is issue of feature”.

I go to my story, and in that field I put the Jira ticket of the feature to which the story belongs to on the Feature Link custom field. This way it triggers the automation.

 

When triggered the feature has story number in the link “issues in feature” and story had feature Jira number under the link “is issue in feature”.

This works really great.However, I need to make sure that entered Jira issue is of issue type Feature. I don not know how can I do achieve it?

Br,

alok

Mark Segall
Community Champion
August 25, 2023

I appreciate the added detail, but unfortunately, I'm still not quite understanding the context behind why automation needs to know the issue type.  It would help if you could share a screenshot of the rule.

Alok Juneja
Contributor
August 31, 2023

Sorry for the very late reply @Mark Segall 

I found Issue Picker function in scriptrunner that solved my issue. What I was trying to write the Jira tickets as text and then converting them to issue link. The function issue Picker has solved all my concerns. I think we should close this conversation.

 

 Br,

Alok

Like Mark Segall likes this

Suggest an answer

Log in or Sign up to answer