Forums

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

If Issue is linked to ABC-1, also link to ABC-2

April_Delay
Contributor
March 23, 2023

Is there a way to create this automation?:

If my issue, CAT-1 is linked to DOG-1, then also link my CAT-1 to DOG-2.

 

Result:

CAT-1 relates to DOG-1

CAT-1 relates to DOG-2

1 answer

0 votes
Arun_Thundyill_Saseendran
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 Champions.
May 14, 2018

Please post your code snippet and we will be able to help! 

Davor Radic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 15, 2018
library that is used is: https://github.com/lesstif/php-jira-rest-client

class
Jira extends Controller
{
private $jiraHost;
private $jiraUsername;
private $jiraPassword;
private $config;

/**
* @Route("/", name="devops_jira")
*/
public function index()
{
$this->jira_auth();
var_dump($this->config);
try {
$proj = new ProjectService($this->config);
$prjs = $proj->getAllProjects();
var_dump($prjs);
foreach ($prjs as $p) {
echo sprintf("Project Key:%s, Id:%s, Name:%s, projectCategory: %s\n",
$p->key, $p->id, $p->name, $p->projectCategory['name']
);
}
} catch (JiraException $e) {
print("Error Occured! " . $e->getMessage());
}

return new Response('');
}

public function jira_auth()
{
$user = $this->getUser();
$this->jiraHost = $user->getJiraHost();
$this->jiraUsername = $user->getJiraUsername();
$this->jiraPassword = $user->getJiraPassword();

$this->config = new ArrayConfiguration(
array(
'jiraHost' => 'https://username.atlassian.net',//$this->jiraHost,
// for basic authorization:
'jiraUser' => $this->jiraUsername,
'jiraPassword' => 'api token',//$this->jiraPassword,
// to enable session cookie authorization (with basic authorization only)
///'cookieAuthEnabled' => true,
'jiraLogFile' => 'DEBUG',
//'curlOptSslVerifyHost' => true
)
);

}
}

Suggest an answer

Log in or Sign up to answer